NPC.StartSchedule

From GMod Wiki

Jump to: navigation, search
Function
Syntax npc:StartSchedule( schedule schedule )
Where is this used?
Description:
Instructs an NPC to follow a specific scripted order.
Returns: nil
In Object: Npc
Part of Library: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.StartSchedule]NPC.StartSchedule [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThe NPC will pick a random node in the 128unit radius and then run to it, then repeats
Used onNewerServer.png
Code
 
local schdRunner= ai_schedule.New( "AI Random Run" )
schdRunner:EngTask("TASK_GET_PATH_TO_RANDOM_NODE", 128)
schdRunner:EngTask("TASK_RUN_PATH", 0)
schdRunner:EngTask("TASK_RELOAD", 0)
npc:StartSchedule(schdRunner)
 
Outputmake the npc pick a random node and run to the position


See Also

NPC.SetSchedule

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox