Esc to clear, Enter to open the best match, click an export to open it in its page
Health & Status

Death & Revive

When a player dies, WHIP puts them in the death state and shows the death screen until they respawn at a hospital or are revived. Your resource can hold a respawn while a medic is on the way, draw its own death screen, and react to deaths and revives.

The death state

WHIP does this by itself and fires whip_core:player:died. While dead:

Dead in a vehicle. They stay slumped in the seat and the car can still be driven. Taken out of a seat, the body falls and lies as on the ground; put into one, it's dead there. A revive in a seat keeps them in it; a respawn takes them out.

Respawning and reviving

The death screen counts down Config.RespawnTime (10 seconds, also in /whip → Settings → Config), then shows Hold E to respawn (A on a controller). Holding it 1.5 seconds respawns them at a random hospital from Config.RespawnLocations (vector4s), with damage modifiers back to normal; the server refuses an earlier respawn.

H (Y on a controller) hides and shows the screen; respawning needs it showing. Themes recolour it with --ui-death-curtain.

Admins revive with /revive [id]: a player's server id, or no id for yourself (console with an id, or in game with whip.devtools). No item is needed. /heal [id] fills a player's health, food and drink, and /kill [id] downs them through the normal death flow, never anyone else of your rank or above (Admin commands). The Player Manager has the same three as Revive, Heal and Kill. Every revive and respawn sets health to 200 and armour to 0 and starts the 10-second spawn guard, when low hunger and thirst cost no health.

Holding a respawn

HoldRespawn(source, key, label?) · ReleaseRespawn(source, key?) · GetRespawnHold(source)SERVER#

Keeps a dead player from respawning while your resource comes for them, such as an EMS call with a medic on the way. The server refuses a respawn until every hold goes: released, a revive, a logout, or the holding resource stopping. GetRespawnHold returns the words their screen shows, or nil.

ParamTypeDescription
sourcenumberThe dead player's server ID
keystringNames your hold; the same key again changes its words
labelstring?Shown instead of "Hold E to respawn", up to 80 letters (default "Help is on the way")
Returns: HoldRespawn: true, or false, 'no such player' | 'they are not dead'. ReleaseRespawn: true when a hold went
local ok, why = exports.whip_core:HoldRespawn(patient, 'call', 'A medic is on the way')
-- The call is dropped: they can respawn once the usual wait is over
exports.whip_core:ReleaseRespawn(patient, 'call')

Checking death state

-- client: the local player
if exports.whip_core:IsPlayerDead() then end

-- server
local player = exports.whip_core:GetPlayer(source)
if player and player.isDead then end

-- any client, any player: the statebag
local isDead = Player(serverId).state.whipDead

Events

EventSidePayload
whip_core:player:diedServer{ source, charId, killer, reported }: killer is the server id the server saw do it (a car's driver counts), or nil; reported is the victim's own game's description, for display only
whip_core:player:revivedServer{ source, charId, how, reason }: how is 'revived' or 'respawned'
whip_core:player:diedClient{ reconnected, respawnRefused }
whip_core:player:revivedClient{ how }
whip_core:death:screenChangedClientWhat the death screen shows: { state = 'count', left, total }, { state = 'ready', progress, key }, { state = 'held', label }, { state = 'off' } or { hidden }

For a death screen of your own, set Config.DeathScreen = false and draw from whip_core:death:screenChanged; WHIP still counts down and reads E. The console and Stats change log print what killed a player, marked "reported": [whip_core] John [3] has died — reported: Carbine Rifle by Jane (#5) (charId: 12). A player who dies of hunger or thirst reads Starvation or Dehydration; health a script or effect takes reads as its reason.

Never pay out on a server event alone. Any server resource can fire whip_core:player:died and whip_core:player:revived.