NPC.SetSchedule

From GMod Wiki

Jump to: navigation, search
Function
Syntax npc:SetSchedule( Enum schedule )
Description:
Instructs an NPC to follow a specific engine order.
Returns: nil
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.SetSchedule]NPC.SetSchedule [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

Descriptionmake the npc's current base position( last memorized position ) to where the player shoots, redirect his action AI to run, which should make him run to the position
Used onNewerServer.png
Code
npc:SetLastPosition( util.QuickTrace( plyobj:GetShootPos(), plyobj:GetAimVector()*1000 ).HitPos + Vector( 0, 0, 40 ) )
npc:SetSchedule( SCHED_FORCED_GO_RUN ) -- run move
OutputCauses the npc to run towards the hit position of the player gun shot (aim trace) having info_node entities helps the npcs navigate so they can travel far distances


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox