Garry's Mod Wiki

Garry's Mod Wiki

  NPC:SetSchedule( number schedule )

Description

Sets the NPC's current schedule.

Arguments

1 number schedule
The NPC schedule, see SCHED enum.

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 ) -- npc:SetSchedule( SCHED_FORCED_GO_RUN ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...