SetPlayerDead

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:55, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 revivePlayer or apply an explicit respawn policy.