# Entity:GetAttachments

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

```lua
table Entity:GetAttachments()
```

## Açıklama

Belirtilen varlığın modelindeki tüm eklentileri içeren bir tablo döndürür.

> **HATA:** Bu, tek oyunculu modda tutarsız sonuçlar verebilir.
> Sorun Takipçisi: [3167](https://github.com/Facepunch/garrysmod-issues/issues/3167)

## Döndürülen Değerler

1. [table](https://gmod.tr/wiki/table): Eklenti verisi. Bkz. [AttachmentData yapısı](https://gmod.tr/wiki/Structures/AttachmentData). Modelin eklentisi olmaması veya başka bir tür sorun olması durumunda boş bir tablo döndürür.

### Örnek

Kleiner oyuncu modelinde bulunan tüm eklentiler

```lua
PrintTable(LocalPlayer():GetAttachments())
```

**Çıktı:**

```lua
1:
		id	=	1
		name	=	eyes
2:
		id	=	2
		name	=	lefteye
3:
		id	=	3
		name	=	righteye
4:
		id	=	4
		name	=	nose
5:
		id	=	5
		name	=	mouth
6:
		id	=	6
		name	=	tie
7:
		id	=	7
		name	=	pen
8:
		id	=	8
		name	=	chest
9:
		id	=	9
		name	=	hips
10:
		id	=	10
		name	=	lefthand
11:
		id	=	11
		name	=	righthand
12:
		id	=	12
		name	=	forward
13:
		id	=	13
		name	=	anim_attachment_RH
14:
		id	=	14
		name	=	anim_attachment_LH
15:
		id	=	15
		name	=	anim_attachment_head
```

### Örnek

Tüm oyuncuların eklenti adlarını görüntüler

```lua
hook.Add( "PostPlayerDraw", "DrawAttachments", function( ply )
    local attachments = ply:GetAttachments()
    for _, att in pairs( attachments ) do
        local attPos = ply:GetAttachment( att.id )
        cam.Start2D()
        local toScreen = attPos.Pos:ToScreen()
        draw.DrawText( att.name, nil, toScreen.x, toScreen.y, nil, TEXT_ALIGN_CENTER )
        cam.End2D()
    end
end )
```

**Çıktı:**

![image.png](https://gmod.tr/api/uploads/wiki/73cded075ddd4d1bc087.png)

- [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:GetAttachments
