OnNpcDeath

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

onNpcDeath

AVAILABLE FROM UPDATE 0.1.5
This event is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.

Reports an NPC transition to dead.

Availability

This event is available in server-side scripts.

Callback signature

function(npcId, sourceId)

Parameters

Name Type Description
npcId int Dead NPC.
sourceId int Source actor ID; 0 for script-caused death.

Notes

  • Listen with addEventHandler(eventName, root, handler). Server observation/event, not client authority.
  • Emitted once for a life transition, not each corpse update. Setting positive HP revives without restoring old targeting.
  • See NPC scripting and Update 0.1.5.