Function of Players
players.on_death
Calls fn when a player dies, with the cause (fall, drown, void, lava, ...) and the line broadcast; player is nil once they have left.
players.on_death(fn: (player: Player?, cause: string, message: string, by: Player?) -> ()) → Connection
Parameters
Returns
ConnectionUsed in
players.on_death(function(player, cause, message, by) end) -> connection -- by: the player who did it, or nilPlayers`cause` in `players.on_death` is one of `fall`, `drown`, `suffocate`, `void`,Players- At zero health the player dies. `players.on_death` fires with causeBody and movement`player.health` to heal, `players.on_death` and `players.on_respawn` for whatRoom rules