Garry's Mod Wiki

NPC:MoveOrder

NPC:MoveOrder( Vector position )

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

1 Vector position
The target position for the NPC to walk to.

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 )

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 5
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 12