# getPedAnimationLength (Cliente)

> Diz a duração da animação que o ped toca, como a de `setPedAnimation`.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Cliente
- **Categoria**: Animações
- **URL**: https://wiki.mymp.gg/pt/getPedAnimationLength

## Sintaxe

```lua
float getPedAnimationLength(ped ped)
```

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `ped` | `ped` | O ped ou jogador. |

## Retorno

A duração em segundos, ou `-1` se o ped não toca uma animação nomeada ou está fora do alcance de streaming.

## Exemplo

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

## Veja também

- [getPedAnimationProgress (Cliente)](https://wiki.mymp.gg/pt/getPedAnimationProgress.md): Diz em que ponto está a animação que o ped toca, como a de setPedAnimation.
- [getPedAnimation (Cliente)](https://wiki.mymp.gg/pt/getPedAnimation.md): Diz qual animação de setPedAnimation um ped está tocando neste cliente.
