OnNPCDeath

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
OnNPCDeath

Type: Event
Context: Server
Introduced: v1.0

Description

Event thats called when a NPC dies.

Syntax

OnNPCDeath(npc, player)

Parameters

  • npc
    The npc that died.
  • player
    Instigator, 0 if not killed by a player.

Example

AddEvent("OnNPCDeath", function(npcId, playerId)
    if playerId != 0 then
        -- If the death is inspected by a real player
    end
end)

See also