# getPedAnimationLength (Cliente)

> Indica la duración de la animación que reproduce el ped, como la de `setPedAnimation`.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Cliente
- **Categoría**: Animaciones
- **URL**: https://wiki.mymp.gg/es/getPedAnimationLength

## Sintaxis

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

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `ped` | `ped` | El ped o jugador. |

## Retorno

La duración en segundos, o `-1` si el ped no reproduce una animación con nombre o está fuera del alcance de streaming.

## Ejemplo

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

## Ver también

- [getPedAnimationProgress (Cliente)](https://wiki.mymp.gg/es/getPedAnimationProgress.md): Indica en qué punto está la animación que reproduce el ped, como la de setPedAnimation.
- [getPedAnimation (Cliente)](https://wiki.mymp.gg/es/getPedAnimation.md): Indica qué animación de setPedAnimation reproduce un ped en este cliente.
