M MY Multiplayer: Wiki
Side
Kind

setPedAnimationSpeed

Client

Changes the speed of an animation the ped is playing.

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

Parameters

NameTypeDescription
pedelementThe ped or player. An element with peds below it in the tree applies to all of them.
animstringThe animation's name, as given to setPedAnimation.
speedfloatThe 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

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

See also