SetPlayerDead
setPlayerDead
Places a player in the authoritative dead state until explicitly revived or respawned by the gamemode.
Syntax
bool setPlayerDead(int playerId [, int killerId = 0, string reason = "script"])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
killerId |
int |
no | Optional connected source player id; defaults to 0. |
reason |
string |
no | Safe reason key up to 32 characters; defaults to script. |
Returns
Returns true when the life-state transition is accepted; otherwise returns false.
Examples
Keep a defeated player down until an RP system revives them:
setPlayerDead(playerId, killerId, "execution")
Notes
- Available only in server-side resource scripts.
- Dead players cannot move, attack, or cast spells.
- There is no automatic recovery from this state. Call
revivePlayeror apply an explicit respawn policy.