OnNpcDestroy

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

onNpcDestroy

Triggered after a resource-owned scripted NPC is removed.

Availability

This event is available in server-side scripts.

Callback signature

onNpcDestroy(npcId, sourceResource)

Parameters

Name Type Description
npcId int The removed NPC identifier.
sourceResource string The resource that owned the NPC.

Examples

Handle the event:

addEventHandler("onNpcDestroy", root, function(npcId, sourceResource)
    outputDebugString("Removed NPC " .. npcId)
end)