OnNPCDeath: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
28days (talk | contribs)
No edit summary
 
Line 16: Line 16:
     end
     end
end)
end)
<syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{Template:NPCEvents}}
{{Template:NPCEvents}}

Latest revision as of 07:09, 13 December 2019

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