# Entity:SetBoneMatrix

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

```lua
Entity:SetBoneMatrix( number boneid, VMatrix matrix )
```

## Açıklama

Verilen kemiğin kemik matrisini, verilen matrise ayarlar. Ayrıca bakınız: [Entity:GetBoneMatrix](https://gmod.tr/wiki/Entity:GetBoneMatrix). `__INVALIDBONE__` kemikleri üzerinde kullanıldığında yakalanamayan bir hataya neden olur, bunu önlemenin bir yolu için örneklere bakın.

> **NOT:** Sunucu tarafında mevcut olmasına rağmen hiçbir şey yapmaz.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) **boneid**: Kemiğin ID'si
2. [VMatrix](https://gmod.tr/wiki/VMatrix) **matrix**: Ayarlanacak matris.

### Örnek

Kemiğin geçerli olup olmadığını kontrol edin, eğer geçerliyse kemik matrisini uygulayın

```lua
if ent:GetBoneName(boneid) ~= "__INVALIDBONE__" then
	ent:SetBoneMatrix(boneid, bonematrix)
end
```

### Örnek

Fonksiyonun örnek kullanımı.

Bir NPC'ye nişan alın ve konsolunuza "bones_cl" yazın.

```lua
if ( CLIENT ) then
	concommand.Add( "bones_cl", function( ply )
		local ent = ply:GetEyeTrace().Entity
		if ( !IsValid( ent ) ) then return end

		ent:AddCallback( "BuildBonePositions", function( ent, numbones )
			for i = 0, numbones - 1 do
				local mat = ent:GetBoneMatrix( i )
				if ( !mat ) then continue end

				local scale = mat:GetScale()
				mat:Scale( Vector( 1, 1, 1 ) * 0.5 )
				ent:SetBoneMatrix( i, mat )
			end
		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/Entity:SetBoneMatrix
