Garry's Mod Wiki

Garry's Mod Wiki

  NPC:SetCondition( number condition )

Description

Sets an NPC condition.

Arguments

1 number condition
The condition index, see COND enum.

Example

Freezes an NPC for a period of time.

function FreezeNPCTemporarily(npc, delay) if(!IsValid(npc)) then return end delay = delay or 1 npc:SetSchedule(SCHED_NPC_FREEZE) timer.Simple(delay, function() if(IsValid(npc)) then npc:SetCondition(COND.NPC_UNFREEZE) end end) 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...