M MY Multiplayer: Wiki
Side
Kind

getPedAnimationLength

Client

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

float getPedAnimationLength(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player.

Returns

The length in seconds, or -1 if the ped plays no named animation or is streamed out.

Example

local length = getPedAnimationLength(localPlayer)
if length > 0 then
    local left = length * (1 - getPedAnimationProgress(localPlayer))
    outputDebugString(("%.1f s left"):format(left))
end

See also