Garry's Mod Wiki

NPC:IsCurrentSchedule

  boolean NPC:IsCurrentSchedule( number schedule )

Description

Returns whether or not the NPC is performing the given schedule.

Arguments

1 number schedule
The schedule number, see SCHED enum.

Returns

1 boolean
True if the NPC is performing the given schedule, false otherwise.

Example

Function which returns the schedule an NPC is performing.

function GetNPCSchedule(npc) if(!IsValid(npc)) then return end for s = 0, LAST_SHARED_SCHEDULE-1 do if(npc:IsCurrentSchedule(s)) then return s end end return 0 end