# tobool

- **Ortam:** İstemci, Sunucu, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Global.tobool
- **Çeviri tarihi:** 2025-09-08

```lua
boolean tobool( any input )
```

## Açıklama

Verilen değer için uygun bir boolean (doğru/yanlış) değeri döndürmeye çalışır.

## Argümanlar

1. [any](https://gmod.tr/wiki/any) **input**: Boolean'a dönüştürülecek nesne.

## Döndürdükleri

1. [boolean](https://gmod.tr/wiki/boolean): - Boolean `false` için `false`. - `"false"` metni için `false`. - `"0"` metni için `false`. - Sayısal `0` için `false`. - `nil` için `false`. - Diğer tüm durumlar için `true`.

### Örnek

Bu fonksiyonun çeşitli değerlerle çıktısını gösterir.

```lua
print("boolean true:", tobool(true))
print("boolean false:", tobool(false))
print("string true:", tobool("true"))
print("string false:", tobool("false"))
print("numeric 0:", tobool(0))
print("string 0:", tobool("0"))
print("string 1:", tobool("1"))
print("nil:", tobool(nil))
print("text string:", tobool("not a boolean"))
print("empty string:", tobool(""))
print("table:", tobool({"stuff"}))
print("empty table:", tobool({}))
```

**Çıktı:**

```lua
boolean true: true
boolean false: false
string true: true
string false: false
numeric 0: false
string 0: false
string 1: true
nil: false
text string: true
empty string: true
table: true
empty table: true
```

- [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/Global.tobool
