# NPC:SetCondition

- **Ortam:** Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/NPC:SetCondition
- **Çeviri tarihi:** 2025-09-08

```lua
NPC:SetCondition( number condition )
```

## Açıklama

Bir NPC koşulunu ayarlar.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) ile [COND enum](https://gmod.tr/wiki/Enums/COND) **condition**: Koşul indeksi, bakınız [COND enum](https://gmod.tr/wiki/Enums/COND).

### Örnek

Bir NPC'yi belirli bir süre için dondurur.

```lua
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
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/NPC:SetCondition
