# getPedBonePosition (Client)

> Returns the world position of a ped's bone.

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

## Syntax

```lua
vec3|false getPedBonePosition(ped ped, int|string bone)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `bone` | `int\|string` | An MTA bone id up to 54, a rig bone's tag or its name. |

## Returns

A `vec3` with the position. `vec3(0, 0, 0)` if the ped is streamed out. `false` if the id is not one of the body's bones or the ped has no such bone.

For objects and for ids above 54, use `getElementBonePosition`.

## Example

```lua
addEventHandler("onClientRender", root, function()
    local head = getPedBonePosition(localPlayer, 5)
    if head then
        local sx, sy = getScreenFromWorldPosition(head.x, head.y, head.z + 0.3)
        if sx then
            dxDrawText(getPlayerName(localPlayer), sx, sy)
        end
    end
end)
```

### Coming from MTA

In MTA it returns three numbers. Here it returns a `vec3` and also takes rig bones by tag or name.

### Note

Raises an error if the ped is streamed in and has no bone with that tag or name.

## See also

- [getElementBonePosition (Client)](https://wiki.mymp.gg/en/getElementBonePosition.md): Returns the world position of a ped's or object's bone.
- [getElementBoneMatrix (Client)](https://wiki.mymp.gg/en/getElementBoneMatrix.md): Returns the world matrix of a ped's or object's bone.
