NPC/SetSchedule

From Garry's Mod
Jump to: navigation, search
 NPC:SetSchedule( )

Contents

Description

Sets the NPC's current schedule.

Arguments

number schedule

The NPC schedule, see SCHED_ Enums.

Examples

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


Personal tools
Navigation