Scripting/Server/Functions/DestroyNPC

Removes an NPC.

Syntax

DestroyNPC(npc)

Arguments

Returns

bool

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "destroynpc" )
	{
		local result = DestroyNPC( 0 );
		MessagePlayer( "DestroyNPC returned: " + result, player );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Creating world entities

Categories: Server functions | Creating world entities