ENT.StartTask

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameStartTask
SyntaxENT:StartTask( Table task )
DescriptionCalled when a scripted NPC starts a new task from a Schedule.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.StartTask]ENT.StartTask [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints details about the task being started on the NPC.
Used onNewerServer.png
Code
function ENT:StartTask( task )
 
	if task["Type"] == 1 then
		print( "EngTask: " .. task["TaskName"], task["TaskData"] )
	elseif task["Type"] == 2 then
		print( "AddTask: " .. task["FunctionName"],  tostring(task["TaskData"]) )
	end
 
	self.BaseClass.StartTask( self, task )
end
 
OutputThe name and data of the task will be printed to console.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox