client
TaskPlayAnim
FiveM client native documentation with a Lua example.
Summary
Plays an animation on a ped from a loaded dictionary. The core native behind emotes, job actions, and immersion animations.
Returns
void
Parameters
pednumberThe ped.animDictstringLoaded dictionary.animNamestringAnimation clip name.blendIn/blendOutfloatBlend speeds (e.g. 8.0 / -8.0).durationnumberDuration in ms, -1 for full.flagnumberAnimation flags (1 = loop, etc.).Example
TaskPlayAnim(PlayerPedId(), dict, 'idle_a', 8.0, -8.0, -1, 1, 0, false, false, false)Common pitfalls
- Load the dict with RequestAnimDict first.
- Flag 1 loops; flag 0 plays once. Wrong flags cause stuck or one-shot anims.
- ClearPedTasks to stop an animation.
Related natives
Related guides
Managing jobs on your server?
Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.
See Viper Multi-Job →