Exports
DS-Death exposes a couple of net events you can trigger from any script, three client-side exports for state queries / nearby revives, and a set of config-level hooks for plugging in your own triggers on death, revive, respawn, and so on.
Events
Events are the easiest integration point — fire them from your ambulance job, phone, mini-game, or admin tool.
DS-Death:revive
Revives the local player (or the targeted player when triggered from the server). Use this to wire DS-Death into existing revive flows like the ESX ambulance job's esx_ambulancejob:revive handler.
-- Client side
TriggerEvent('DS-Death:revive')
-- Server side (revives the player whose source is passed in)
TriggerClientEvent('DS-Death:revive', source)DS-Death:lockAnim
Locks or unlocks DS-Death's death animation. Useful when another system (ambulance job, custom revive minigame) wants to play its own animation while keeping the player in DS-Death's knocked state. Pass true to lock, false to release.
-- Client side
TriggerEvent('DS-Death:lockAnim', true) -- lock the death animation
TriggerEvent('DS-Death:lockAnim', false) -- release it
-- Server side (target a specific player)
TriggerClientEvent('DS-Death:lockAnim', source, true)Exports
All three exports run on the client. The state queries accept an optional server ID — pass nothing to ask about the local player.
ReviveNear
clientLooks for any knocked players around the local player and tries to revive the closest one. The script handles the item check, the progress bar, and the revive event so you only need to wire this export to whichever interaction trigger you prefer (item use, target option, keybind).
Signature
exports['DS-Death']:ReviveNear()Example
-- e.g. from a usable-item handler or a target option
exports['DS-Death']:ReviveNear()isPlayerDead
clientReturns whether the given player is fully dead (waiting for respawn). Pass a server ID to query another player; pass nothing to check the local player.
Signature
exports['DS-Death']:isPlayerDead(serverId)Parameters
| Name | Type | Description |
|---|---|---|
| serverId? | number | Server ID of the player to query. Defaults to self. |
Returns
true while the player is fully dead, false otherwise.
Example
if exports['DS-Death']:isPlayerDead() then
-- block phone, inventory, etc.
endisPlayerKnocked
clientReturns whether the given player is currently knocked (down but still revivable). Same shape as isPlayerDead — server ID is optional and defaults to self.
Signature
exports['DS-Death']:isPlayerKnocked(serverId)Parameters
| Name | Type | Description |
|---|---|---|
| serverId? | number | Server ID of the player to query. Defaults to self. |
Returns
true while the player is knocked and waiting for revive.
Example
local target = GetClosestPlayer()
if exports['DS-Death']:isPlayerKnocked(GetPlayerServerId(target)) then
-- show "Revive" prompt
endConfig hooks
Beyond events and exports, config.lua ships with a handful of empty functions you can extend without touching the escrowed core. Drop your own triggers/exports inside any of these.
- OnKnocked, OnDeath, OnRevive, OnRespawn — fired on the matching player state transition.
- CanDie — return
falseto suppress the death loop entirely (e.g. inside a minigame, airsoft round, or PvP arena). - EMSCall — receives the dying player's coords; route this to your phone's emergency-call trigger.
- Notification — replace with your own notify system; receives a string message.
- CustomProgress / StopCustomProgress — wire any progress bar (
ox_lib, custom UI, etc.) whenProgressbar = 'CUSTOM'in the config. - DisabledKeys — the controls disabled while the player is fully dead. Override to keep your own controls usable.
exports['DS-Death']:isPlayerKnocked() from inside OnKnocked to gate other systems (phone, inventory, radio) without polling.