OnNpcDestroy

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

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)