KillPlayer

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:54, 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

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 setPlayerDead when no damage event is desired and the explicit dead state is the intent.