DestroyNPC: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
28days (talk | contribs)
No edit summary
 
Line 23: Line 23:
{{RelatedFunctions}}
{{RelatedFunctions}}
* [[CreateNPC]]
* [[CreateNPC]]
* [[IsValidNPC]]

Latest revision as of 15:27, 17 November 2019

DestroyNPC

Type: Function
Context: Server
Introduced: v1.0

Description

Destroy/remove any NPC by its identifier.

Syntax

DestroyNPC(npc)

Parameters

  • npc
    NPC You want to destroy/remove

Return Value

  • Returns true on success.

Example

function deleteNPC(player, npc)
   if IsValidNPC(tonumber(npc)) then --Check if npc is valid first
      DestroyNPC(tonumber(npc))
   end
end
AddCommand('removenpc', deleteNPC)


See also