# getElementBoneMatrix (Client)

> Returns the world matrix of a ped's or object's bone.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Components and bones
- **URL**: https://wiki.mymp.gg/en/getElementBoneMatrix

## Syntax

```lua
table|false getElementBoneMatrix(ped|object element, int|string bone)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `ped\|object` | The ped, player or object. An object needs a model with a skeleton or a node tree. |
| `bone` | `int\|string` | The bone. On a ped: an MTA bone id, a rig bone's tag or its name. On an object: a node's name or a bone's tag. |

## Returns

A table of four rows of four numbers: the right, forward and up axes, then the position. `false` if the element is streamed out.

## Example

```lua
local matrix = getElementBoneMatrix(localPlayer, 34)
if matrix then
    local position = matrix[4]
    outputDebugString(("Left hand at %.2f, %.2f, %.2f"):format(position[1], position[2], position[3]))
end
```

### Coming from MTA

In MTA it works on peds only. Here it also takes objects and rig bones by tag or name.

### Note

Raises an error if the element has no such bone. While the element is streamed out, it returns `false`.

## See also

- [setElementBoneMatrix (Client)](https://wiki.mymp.gg/en/setElementBoneMatrix.md): Sets the world matrix of a ped's or object's bone: position, orientation and scale at once. The change applies on this client only.
- [getElementBonePosition (Client)](https://wiki.mymp.gg/en/getElementBonePosition.md): Returns the world position of a ped's or object's bone.
- [getElementBoneRotation (Client)](https://wiki.mymp.gg/en/getElementBoneRotation.md): Returns the rotation of a ped's or object's bone relative to its parent bone, in degrees.
