NPC:SetCondition
Description
Sets an NPC condition.
Arguments
Example
Freezes an NPC for a period of time.
COND_NPC_UNFREEZE = 68 -- Delete this line when COND_ enums are added
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