Garry's Mod Wiki

NPC:SetSchedule

NPC:SetSchedule( number schedule )

Description

Sets the NPC's current schedule.

Arguments

1 number schedule
The NPC schedule, see Enums/SCHED.

Example

Function which forces an NPC to walk to an entity.

function NPCMoveTo(npc, ent) if(!IsValid(npc) or !IsValid(ent)) then return end npc:SetSaveValue("m_vecLastPosition", ent:GetPos()) npc:SetSchedule(SCHED_FORCED_GO) end

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 4
Generate Html 5
SaveChanges (1) 9
Render Body 0
Render Sidebar 12