getPedAnimationLength
Client
Tells the length of the animation the ped is playing, such as one from setPedAnimation.
float getPedAnimationLength(ped ped)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The 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