KillPlayer
killPlayer
Applies lethal authoritative script damage to a living player.
Syntax
bool killPlayer(int playerId [, int killerId = 0])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
killerId |
int |
no | Optional connected killer id; use 0 for a server-side death. |
Returns
Returns true when the lethal damage request is accepted; otherwise returns false.
Examples
Kill a player from a gamemode command:
killPlayer(playerId)
Notes
- Available only in server-side resource scripts.
- This uses the regular authoritative damage and death pipeline, including death events and gamemode downed/dead policy.
- Use
setPlayerDeadwhen no damage event is desired and the explicit dead state is the intent.