Garry's Mod Wiki

NPC:UseFollowBehavior

  boolean NPC:UseFollowBehavior()

Description

This function only works on ai type SENTs.

Returns

1 boolean
If we succeeded setting the behavior.

Example

Create a base_ai that follows the player, using console commands and Lua.

ent_create base_ai targetname alyx additionalequipment weapon_ar2 ent_create ai_goal_follow goal !player formation 0 actor alyx searchtype 0 startactive 1 -- Execute Lua code below after a second: lua_run ents.FindByName("alyx")[1]:UseFollowBehavior()