Garry's Mod Wiki

Revision Difference

ENTITY:StartTask#565183

<function name="StartTask" parent="ENTITY" type="hook"> <description>Called once on starting task. <note>This hook only exists for `ai` type [SENTs](Scripted_Entities).</note>⤶ <description>Called once when a LUA schedule has started a task. <note>This is a helper function only available if your SENT is based on `base_ai`</note>⤶ </description> <realm>Server</realm> <file line="129">gamemodes/base/entities/entities/base_ai/schedules.lua</file>⤶ <args> <arg name="task" type="Task">The task to start, created by <page>ai_task.New</page>.</arg> </args> </function> ⤶ <example>⤶ <description>How it is defined:</description>⤶ <code>⤶ function ENT:StartTask( task )⤶ task:Start( self.Entity )⤶ end⤶ </code>⤶ ⤶ </example>