# getElementBoneRotation (Client)

> Returns the rotation of a ped's or object's bone relative to its parent bone, in degrees.

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

## Syntax

```lua
vec3|false getElementBoneRotation(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 `vec3` with `yaw, pitch, roll` in degrees, or `false` if the element is streamed out or the bone has no pose.

## Example

```lua
local rotation = getElementBoneRotation(localPlayer, 5)
if rotation then
    outputDebugString(("Head: yaw %.1f, pitch %.1f, roll %.1f"):format(rotation.x, rotation.y, rotation.z))
end
```

### Coming from MTA

In MTA it works on peds only and returns three numbers. 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

- [setElementBoneRotation (Client)](https://wiki.mymp.gg/en/setElementBoneRotation.md): Turns a ped's or object's bone relative to its parent bone. The change applies on this client only.
- [getElementBoneQuaternion (Client)](https://wiki.mymp.gg/en/getElementBoneQuaternion.md): Returns the orientation of a ped's or object's bone relative to its parent bone, as a quaternion.
- [getElementBoneMatrix (Client)](https://wiki.mymp.gg/en/getElementBoneMatrix.md): Returns the world matrix of a ped's or object's bone.
