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
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →