NPC/MoveOrder

From Garry's Mod
Jump to: navigation, search
 NPC:MoveOrder( )

Contents

Description

Makes the NPC walk toward the given position. The NPC will return to the player after amount of time set by player_squad_autosummon_time ConVar.

Only works on Citizens (npc_citizen) and is a part of the Half-Life 2 squad system.

The NPC must be in the player's squad for this to work.

Arguments

Vector position

The target position for the NPC to walk to.

Examples

Example

A console command that makes all Citizens on the map (if they are in the player's squad) try to go to where the player is looking at.

concommand.Add( "movenpcs", function( ply )
	for id, npc in pairs( ents.FindByClass( "npc_citizen" ) ) do
		npc:MoveOrder( ply:GetEyeTrace().HitPos )
	end
end )


Personal tools
Navigation