client
RequestAnimDict
FiveM client native documentation with a Lua example.
Summary
Loads an animation dictionary so you can play its animations. Pair with HasAnimDictLoaded in a wait loop before TaskPlayAnim.
Returns
void
Parameters
animDictstringThe animation dictionary name.Example
local dict = 'amb@world_human_hang_out_street@male_c@base'
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do Wait(0) end
TaskPlayAnim(PlayerPedId(), dict, 'base', 8.0, -8.0, -1, 1, 0, false, false, false)Common pitfalls
- Wait for HasAnimDictLoaded before playing, or the anim silently fails.
- Call RemoveAnimDict when done to free memory.
- Add a timeout so a bad dict name doesn't hang forever.
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 →