NPC.IsCurrentSchedule

From GMod Wiki

Jump to: navigation, search
Function
Syntax npc:IsCurrentSchedule( Integer schedule )
Description:
Checks if an NPC is running the given schedule
Returns: Boolean
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.IsCurrentSchedule]NPC.IsCurrentSchedule [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the NPCs schedule to SCHED_FORCED_GO_RUN only if that is not already its current schedule
Used onNewerServer.png
Code
if !npc:IsCurrentSchedule(SCHED_FORCED_GO_RUN) then
        npc:SetSchedule( SCHED_FORCED_GO_RUN ) -- only set this schedule if it is not already running
end
OutputCauses the npc to run to the last position


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox