RedM documentation

Murphy's Doctor

Configuration

Temperature


This page covers shared/config_temperature.lua: the body temperature simulation (ambient temperature, clothing insulation, shelter, heat sources, weather, wind and time of day) and the hypothermia and hyperthermia effects.

How it works

Every player has a body temperature in °C, 37 at rest. Every System.UpdateInterval seconds the client reads the ambient temperature at the player's position and moves the body temperature toward cold or heat:

  1. Ambient zone. Below ComfortZone.min the body cools, above ComfortZone.max it warms, in between it recovers toward 37 at RecoveryRate.
  2. Raw change. The further the ambient temperature is from the comfort zone, the faster the change: (gap / comfort bound) x ChangeRate degrees per tick.
  3. Clothing. The change is reduced by protection level x ClothingFactor (protection 0 to 3, see below). Cold weather and night cold are also damped by clothing; the sun's warmth is not.
  4. Shelter. Indoors, the change is multiplied by InteriorProtection.DeltaMultiplier.
  5. Bonuses and maluses. Running, sprinting and standing by a heat source warm the body; the weather (with wind chill) and the hour of the day add their modifier.
  6. Physiological cap. In the cold, running or a fire warm you back up to 37 but never give you a fever; in the heat, rain or night cool you down to 37 but never into hypothermia.
  7. Bounds. The result is clamped to BodyTempLimits and rounded to 0.1 °C.

The temperature does not change while the player is in a coma.

Thresholds at a glance (defaults)

Body temperature State What the player gets
37.5 °C and above Feeling hot Red HUD icon, "you start to feel hot" notification.
38 °C and above Hot / mild hyperthermia "Hot" condition, thirst drains 1.5x faster.
39.5 °C and above Moderate hyperthermia Thirst 2x, stamina drain.
41 °C and above Severe hyperthermia Thirst 3x, stamina and health drain, sweat-wipe animation.
36 °C and below Feeling cold Blue HUD icon, "you start to feel cold" notification.
35 °C and below Cold / mild hypothermia "Cold" condition, shivering walk.
33 °C and below Moderate hypothermia Stamina drain.
31 °C and below Severe hypothermia Erratic walk, stamina and health drain, shiver animation.
  • Doctor's examination. A cold player shows a cyanotic complexion and shivering, a hot player a flushed complexion. The doctor can treat the "hypothermia" and "heatstroke" conditions with a medication whose treats list includes them (see Treatment).
  • Infection. Staying in the "cold" state for Config.Infection.Cold.MinExposureSeconds rolls flu and pneumonia (see Infection).
  • Metabolism. Hyperthermia multiplies thirst decay (see Metabolism).
  • Drunk walk. While the drunk walk is active, it takes priority over the hypothermia walk.
  • Consumables. An item can shift the body temperature for a while with temperatureEffect (see Consumables).

Thresholds

Key Default Description
Config.Temperature.cold 35 °C. At or below, the player gets the "cold" condition (examination, prescriptions, infection trigger) and the hypothermia notification.
Config.Temperature.hot 38 °C. At or above, the player gets the "hot" condition and the hyperthermia notification.
Config.Temperature.FeelingCold 36 °C. At or below, the blue HUD icon appears and a first warning is sent, before hypothermia.
Config.Temperature.FeelingHot 37.5 °C. At or above, the red HUD icon appears and a first warning is sent, before hyperthermia.
Config.Temperature.ConditionDeadBand 0.5 °C. Once "cold", the player must climb this much above cold to leave the state (and the same below hot). Prevents the state and its notification from flickering around the threshold.
Config.Temperature.normal { min = 36, max = 37.5 } Reference range, kept for readability. Not read by the script.

Simulation

Key Default Description
Config.Temperature.System.Enabled true Runs the simulation. When false, the body temperature stays at its stored value.
Config.Temperature.System.UpdateInterval 10 Seconds between two updates. Every "per tick" value on this page is applied once per update.
Config.Temperature.System.ChangeRate 0.15 Base change in degrees per tick, scaled by how far the ambient temperature is outside the comfort zone.
Config.Temperature.System.RecoveryRate 0.15 Degrees per tick the body returns toward 37 in the comfort zone. Also the minimum rate at which a warm body cools in the cold (and a cold body warms in the heat).
Config.Temperature.System.ComfortZone.min 5 Ambient °C below which the body cools.
Config.Temperature.System.ComfortZone.max 32 Ambient °C above which the body warms.
Config.Temperature.System.BodyTempLimits.min 30 Lowest possible body temperature.
Config.Temperature.System.BodyTempLimits.max 42 Highest possible body temperature.
Config.Temperature.System.ClothingFactor 0.35 Share of the change removed per protection level. With 0.35: level 1 = 35%, level 2 = 70%, level 3 = 100% (capped).

Physical activity

Key Default Description
Config.Temperature.System.ActivityWarmth.running 0.05 Degrees added per tick while running, in the cold zone only.
Config.Temperature.System.ActivityWarmth.sprinting 0.10 Degrees added per tick while sprinting, in the cold zone only.

Shelter

A player is indoors when the game places them in an interior.

Key Default Description
Config.Temperature.System.InteriorProtection.Enabled true Applies the shelter reduction.
Config.Temperature.System.InteriorProtection.DeltaMultiplier 0.3 Multiplier on the ambient change indoors (0.3 = only 30% of the cold or heat reaches the player, 1.0 = no shelter).

Heat sources

Key Default Description
Config.Temperature.System.HeatSources.Enabled true Fires, stoves and torches warm nearby players.
Config.Temperature.System.HeatSources.DetectionRadius 3.0 Metres around the player.
Config.Temperature.System.HeatSources.WarmthBonus 0.15 Degrees added per tick near a source. Applies in the cold zone and speeds up the recovery from cold in the comfort zone.
Config.Temperature.System.HeatSources.Props 25 models Prop models that radiate heat, as names or hashes. Shipped: campfires (p_campfire01x to p_campfire05x, p_campfire_small01x, p_campfirelarge01x, p_campfireindian01x), stoves (p_stove01x to p_stove05x, p_stovecamp01x, p_woodstove01x), fireplaces (p_fireplace01x to p_fireplace03x, p_fireplaceset01x, p_fireplaceset02x), fire barrels (p_barrel_fire01x, p_barrel_fire02x) and torches (p_torch01x, p_torch02x, p_torchwall01x).
lua
-- add a custom camp stove and a prop given by its hash
table.insert(Config.Temperature.System.HeatSources.Props, "p_mycampstove01x")
table.insert(Config.Temperature.System.HeatSources.Props, -1234567890)

Weather

The weather is read from weathersync (the weathersync:changeWeather event). As weathersync does, the raw weather is translated by region: rain becomes snow in the snowy north or when the local temperature is below 0 °C, a thunderstorm becomes a blizzard, a hurricane becomes a whiteout (or a sandstorm in the desert), and so on. Without any weather resource the weather modifier stays at 0.

With another weather script, send the weather name to the client whenever it changes:

lua
-- client side
TriggerEvent("murphy_doctor:setWeather", "rain")
-- server side
TriggerClientEvent("murphy_doctor:setWeather", -1, "snow")

Config.Temperature.System.WeatherModifiers maps a weather name to degrees added per tick. Negative cools, positive warms. In the cold zone a negative modifier is damped by clothing.

Weather Default Weather Default
blizzard -0.06 drizzle -0.01
whiteout -0.05 fog -0.01
groundblizzard -0.04 misty -0.01
snow -0.03 overcast 0
snowlight -0.02 overcastdark 0
sleet -0.02 clouds 0
hail -0.02 highpressure 0.01
thunderstorm -0.02 sunny 0.02
hurricane -0.03 sandstorm 0.03
rain -0.02 - -
thunder -0.01 - -
shower -0.01 - -

A weather name missing from the table counts as 0.

Key Default Description
Config.Temperature.System.WindChillFactor 0.03 Wind amplifies cold weather: a negative modifier is multiplied by 1 + windSpeed x WindChillFactor (wind 10 = +30% cold).

Time of day

Config.Temperature.System.TimeOfDayModifiers gives, for each in-game hour from [0] to [23], degrees added per tick. Night cold is damped by clothing in the cold zone; daytime warmth is not.

Hours Default Hours Default
0, 1 -0.04 12, 13, 14 0.04
2, 3 (coldest) -0.05 15 0.03
4 -0.04 16 0.02
5 -0.03 17 0.01
6 -0.02 18 0
7 -0.01 19 -0.01
8 0 20 -0.02
9 0.01 21, 22 -0.03
10 0.02 23 -0.04
11 0.03 - -

Clothing insulation

Each player has a cold protection and a heat protection from 0 to 3.

  • When murphy_clothing is running, the levels come from its GetTemperatureProtection export (its own Config.TemperatureProtection).
  • Otherwise the script detects the equipped clothing categories itself, with no dependency, using the settings below.
Key Default Description
Config.Temperature.System.ClothingDetection.Categories see below Clothing category name → "warm" (protects from cold), "cold" (protects from heat) or "neutral" (no effect).
Config.Temperature.System.ClothingDetection.ProtectionLevels.cold [0]=0, [1]=2, [2]=2, [3]=3, [4]=3, [5]=3 Number of equipped "warm" items → cold protection level. A count above the table gives level 3. One coat is enough for level 2.
Config.Temperature.System.ClothingDetection.ProtectionLevels.heat [0]=0, [1]=1, [2]=2, [3]=3 Number of equipped "cold" items → heat protection level. A count above the table gives level 3.

Shipped categories:

Type Categories
warm coats, coats_closed, coats_heavy, ponchos, cloaks, vests, overalls_full, shirts_full_overpants, unionsuits_full, gloves, gauntlets, boots, spats, chaps, aprons, neckwear, neckties
cold skirts
neutral shirts_full, pants, hats, masks, eyewear, suspenders

If you use murphy_clothing, keep both resources in line so a player gets the same protection with or without it.

Hypothermia

Key Default Description
Config.Temperature.Hypothermia.Enabled true Applies the hypothermia effects.
Config.Temperature.Hypothermia.Thresholds.mild 35 °C at or below which the mild stage starts.
Config.Temperature.Hypothermia.Thresholds.moderate 33 °C, moderate stage.
Config.Temperature.Hypothermia.Thresholds.severe 31 °C, severe stage.
Config.Temperature.Hypothermia.CanKill false true = the health drain can bring the player to 0 HP (coma). false = stops at 1 HP.

Per stage, under Config.Temperature.Hypothermia.Effects.<mild|moderate|severe>. The drains are applied every 5 seconds, on both the core and the outer bar.

Field mild moderate severe Description
screenEffect nil nil nil Optional screen effect (animpostfx name) kept on while the stage lasts.
movementClipset "MP_Style_drunk" "MP_Style_drunk" "MP_Style_Crazy" Walk style while the stage lasts (shivering, then erratic).
staminaDrain 0 3 5 Stamina points removed every 5 seconds.
healthDrain 0 0 2 Health points removed every 5 seconds.

At the severe stage the player also plays a short shiver animation about every 20 seconds (not while sprinting).

Hyperthermia

Key Default Description
Config.Temperature.Hyperthermia.Enabled true Applies the hyperthermia effects.
Config.Temperature.Hyperthermia.Thresholds.mild 38 °C at or above which the mild stage starts.
Config.Temperature.Hyperthermia.Thresholds.moderate 39.5 °C, moderate stage.
Config.Temperature.Hyperthermia.Thresholds.severe 41 °C, severe stage.
Config.Temperature.Hyperthermia.CanKill false true = the health drain can bring the player to 0 HP.

Per stage, under Config.Temperature.Hyperthermia.Effects.<mild|moderate|severe>:

Field mild moderate severe Description
screenEffect nil nil nil Optional screen effect kept on while the stage lasts.
thirstDrainMultiplier 1.5 2.0 3.0 Multiplier on thirst decay.
staminaDrain 0 3 5 Stamina points removed every 5 seconds.
healthDrain 0 0 2 Health points removed every 5 seconds.

A movementClipset field can be added to a hyperthermia stage too. At the severe stage the player wipes their sweat about every 20 seconds.

Example: harsher winters, and hypothermia that can kill.

lua
Config.Temperature.System.ComfortZone.min = 8
Config.Temperature.System.WeatherModifiers.blizzard = -0.10
Config.Temperature.Hypothermia.Effects.severe.healthDrain = 4
Config.Temperature.Hypothermia.CanKill = true

Last updated: November 20, 2026