OnPlayerDead
onPlayerDead
Compatibility alias triggered together with onPlayerDeath when health reaches zero.
Availability
This event is available in server-side scripts.
Callback signature
onPlayerDead(playerId, killerId, reason)
Parameters
| Name | Type | Description |
|---|---|---|
playerId |
int |
The player whose health reached zero. |
killerId |
int |
The responsible player ID, or the runtime's no-player value. |
reason |
string |
The authoritative reason for the zero-health transition. |
Examples
Handle the event:
addEventHandler("onPlayerDead", root, function(playerId, killerId, reason)
outputDebugString("Legacy death event for player " .. playerId)
end)
Notes
- Do not register the same policy on both onPlayerDeath and
onPlayerDead, or it will run twice.