# getPedAnimationSpeed (Client)

> Tells the speed of the animation the ped is playing, such as one from `setPedAnimation`.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Animations
- **URL**: https://wiki.mymp.gg/en/getPedAnimationSpeed

## Syntax

```lua
float getPedAnimationSpeed(ped ped)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |

## Returns

The speed, `1` being normal, or `-1` if the ped plays no named animation or is streamed out.

## Example

```lua
local speed = getPedAnimationSpeed(localPlayer)
if speed > 0 then
    setPedAnimationSpeed(localPlayer, "dance_loop", speed * 2)
end
```

## See also

- [setPedAnimationSpeed (Client)](https://wiki.mymp.gg/en/setPedAnimationSpeed.md): Changes the speed of an animation the ped is playing.
- [getPedAnimation (Client)](https://wiki.mymp.gg/en/getPedAnimation.md): Tells which setPedAnimation animation a ped is playing on this client.
