# setPedAnimationSpeed (Client)

> Changes the speed of an animation the ped is playing.

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

## Syntax

```lua
bool setPedAnimationSpeed(element ped, string anim [, float speed = 1])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `element` | The ped or player. An element with peds below it in the tree applies to all of them. |
| `anim` | `string` | The animation's name, as given to `setPedAnimation`. |
| `speed` | `float` | The speed, from 0 to 10. `1` is normal. *(default: `1`)* |

## Returns

`true` if it was changed on the element given. `false` without `anim`, with a speed outside 0 to 10, or if it does not play that animation, is not a ped or is streamed out.

If the ped is streamed out, the speed is kept and applied when it comes back, even though the function returns `false`.

## Example

```lua
setPedAnimation(localPlayer, "DANCING", "dance_loop")
setPedAnimationSpeed(localPlayer, "dance_loop", 0.5)
```

## See also

- [getPedAnimationSpeed (Client)](https://wiki.mymp.gg/en/getPedAnimationSpeed.md): Tells the speed of the animation the ped is playing, such as one from setPedAnimation.
- [setPedAnimation (Client)](https://wiki.mymp.gg/en/setPedAnimation.md): Makes a ped play an animation from a block, or stops the animation it is playing. The animation applies on this client only.
- [setPedAnimationProgress (Client)](https://wiki.mymp.gg/en/setPedAnimationProgress.md): Jumps an animation the ped is playing to a point in it. Without anim, it stops the setPedAnimation animation.
