OnPlayerDead

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 22:31, 14 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerDead

Compatibility alias triggered together with onPlayerDeath when health reaches zero.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerDead(playerId, killerId, reason)

Parameters

Name Type Description
playerId int The player whose health reached zero.
killerId int The responsible player ID, or the runtime's no-player value.
reason string The authoritative reason for the zero-health transition.

Examples

Handle the event:

addEventHandler("onPlayerDead", root, function(playerId, killerId, reason)
    outputDebugString("Legacy death event for player " .. playerId)
end)

Notes

  • Do not register the same policy on both onPlayerDeath and onPlayerDead, or it will run twice.