ENT.SelectSchedule

From GMod Wiki

Revision as of 02:31, 29 August 2010 by Otger (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameSelectSchedule
SyntaxENT:SelectSchedule( )
DescriptionCalled when a scripted NPC have to select its schedule.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.SelectSchedule]ENT.SelectSchedule [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionCreates a new schedule and assigns it to a scripted NPC.
Used onNewerServer.png
Code
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
 
OutputThe scripted NPC will run around when spawned.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox