# Entity:GetNumBodyGroups

- **Ortam:** İstemci, Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Entity:GetNumBodyGroups
- **Çeviri tarihi:** 2025-09-30

```lua
number Entity:GetNumBodyGroups()
```

## Açıklama

[Varlığın](https://gmod.tr/wiki/Entity) modelinin içerdiği Gövde Grubu (Body Group) sayısını döndürür.

> **NOT:** Silahlar, sonuçları kendi görüş modellerinden (viewmodel) döndürür.

## Döndürdüğü Değer

1. [number](https://gmod.tr/wiki/number): Varlığın modelindeki Gövde Grubu sayısı.

### Örnek

Örnek kullanım. Gövde gruplarını rastgele ayarlayan ve tüm gövde gruplarını yazdıran konsol komutları.

```lua
concommand.Add( "print_bodygruops", function( ent )

	print("Here's all the bodygroups for " .. ent:GetModel() )
	for k = 0, ent:GetNumBodyGroups() do
		print( ent:GetBodygroupName( k ), " value ", ent:GetBodygroup( k ), " max ", ent:GetBodygroupCount( k ) )
	end

end )

concommand.Add( "bodygroups_random", function( ent )

	print("Randomizing all the bodygroups for " .. ent:GetModel() )
	for k = 0, ent:GetNumBodyGroups() do
		ent:SetBodygroup( k, math.random( 0, ent:GetBodygroupCount( k ) - 1 ) )
	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/Entity:GetNumBodyGroups
