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:
- They lie where they fell and take no more damage.
- Every control is off except the camera (V and looking around), chat (T), push-to-talk (N) and E to respawn.
- Other players can still escort (drag) them.
- Hunger and thirst stop draining, low ones cost no health, and effects stop ticking.
- Their
healthstat reads 100 (GTA's dead value) and their armour 0. - Leaving doesn't end it: they're still dead when they come back.
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
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.
| Param | Type | Description |
|---|---|---|
| source | number | The dead player's server ID |
| key | string | Names your hold; the same key again changes its words |
| label | string? | Shown instead of "Hold E to respawn", up to 80 letters (default "Help is on the way") |
HoldRespawn: true, or false, 'no such player' | 'they are not dead'. ReleaseRespawn: true when a hold wentlocal 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.whipDeadEvents
| Event | Side | Payload |
|---|---|---|
whip_core:player:died | Server | { 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:revived | Server | { source, charId, how, reason }: how is 'revived' or 'respawned' |
whip_core:player:died | Client | { reconnected, respawnRefused } |
whip_core:player:revived | Client | { how } |
whip_core:death:screenChanged | Client | What 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.
whip_core:player:died and whip_core:player:revived.