ENTITY:SelectSchedule

From Garry's Mod
Jump to: navigation, search
 ENTITY:SelectSchedule( )

Contents

Description

Set the schedule we should be playing right now.

Arguments

number iNPCState

Examples

Example

Creates a new schedule and assigns it to a scripted NPC.

local schdTest = ai_schedule.New( "Test Schedule" )
 
schdTest:EngTask( "TASK_GET_PATH_TO_RANDOM_NODE",  128 )
schdTest:EngTask( "TASK_RUN_PATH", 		   0   )
schdTest:EngTask( "TASK_WAIT_FOR_MOVEMENT", 	   0   )
 
 
function ENT:SelectSchedule()
 
	self:StartSchedule( schdTest )
 
end

Output:

The scripted NPC will run around when spawned.
Personal tools
Navigation