M MY Multiplayer: Wiki
Side
Kind

getPedAnimationSpeed

Client

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

float getPedAnimationSpeed(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player.

Returns

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

Example

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

See also