From Onset Developer Wiki
Event thats called when a NPC dies.
The npc that died.
Instigator, 0 if not killed by a player.
AddEvent("OnNPCDeath", function(npcId, playerId) if playerId != 0 then -- If the death is inspected by a real player end end)