Animation Flags Calculator
Build and decode the flag value for TaskPlayAnim: every eScriptedAnimFlags bit, common presets and a ready Lua snippet with dict loading and a toggle command.
The Animation Flags Calculator builds the flag argument of TaskPlayAnim from named bits, decodes values you find in other scripts, and writes a Lua snippet that loads the dictionary and plays the clip. It is for anyone writing emotes, interactions or cutscene-like moments.
What it is for
The flag decides how an animation behaves: whether it loops, plays on the upper body only, lets the player walk, freezes on the last frame, ignores collision. Most scripts copy 49 around without knowing why. This tool shows every bit with its name from the eScriptedAnimFlags enum, so you can pick exactly what you need or see what a value in an old emote menu does.
Quick start
- Pick a Preset (the page opens on
49, the classic emote flag) or toggle flags by hand. - In the TaskPlayAnim panel, click an Example animation or type your own Anim dictionary and Anim name.
- Adjust Blend in, Blend out, Duration (ms) and Playback rate if needed.
- Copy
play_anim.luafrom the code block under the calculator.
Decode a value in the Animation flag panel accepts 49, 0x31, 0b110001 or 1 | 16 | 32. The value is stored in the URL (?v=) so a link shares it.
Flags
| Bit | Value | Name | What it does |
|---|---|---|---|
| 0 | 1 | AF_LOOPING | Repeats until stopped. |
| 1 | 2 | AF_HOLD_LAST_FRAME | Freezes on the last frame instead of blending out. |
| 2 | 4 | AF_REPOSITION_WHEN_FINISHED | Moves the ped to where the clip ended. |
| 3 | 8 | AF_NOT_INTERRUPTABLE | AI events and other tasks cannot interrupt it. |
| 4 | 16 | AF_UPPERBODY | Only the upper body plays the clip. |
| 5 | 32 | AF_SECONDARY | Runs as a secondary task: the player keeps control. |
| 6 | 64 | AF_REORIENT_WHEN_FINISHED | Applies the clip’s final heading to the ped. |
| 7 | 128 | AF_ABORT_ON_PED_MOVEMENT | Stops as soon as the ped moves. |
| 8 | 256 | AF_ADDITIVE | Plays as an additive layer on the current pose. |
| 9 | 512 | AF_TURN_OFF_COLLISION | No ped collision while playing. |
| 10 | 1024 | AF_OVERRIDE_PHYSICS | The clip fully drives position, physics ignored. |
| 11 | 2048 | AF_IGNORE_GRAVITY | No gravity while playing. |
| 12 | 4096 | AF_EXTRACT_INITIAL_OFFSET | Applies the clip’s initial mover offset. |
| 13 | 8192 | AF_EXIT_AFTER_INTERRUPTED | Ends the task once interrupted. |
| 14 | 16384 | AF_TAG_SYNC_IN | Syncs the blend in with sync tags. |
| 15 | 32768 | AF_TAG_SYNC_OUT | Syncs the blend out with sync tags. |
| 16 | 65536 | AF_TAG_SYNC_CONTINUOUS | Keeps syncing to tags the whole time. |
| 17 | 131072 | AF_FORCE_START | Starts this frame even if the ped is busy. |
| 18 | 262144 | AF_USE_KINEMATIC_PHYSICS | Pushes objects but is not pushed back. |
| 19 | 524288 | AF_USE_MOVER_EXTRACTION | Moves the ped with the clip’s mover track. |
| 20 | 1048576 | AF_HIDE_WEAPON | Hides the weapon while playing. |
| 21 | 2097152 | AF_ENDS_IN_DEAD_POSE | The clip ends in a dead pose. |
| 22 | 4194304 | AF_ACTIVATE_RAGDOLL_ON_COLLISION | Ragdolls on collision. |
| 23 | 8388608 | AF_DONT_EXIT_ON_DEATH | Keeps playing if the ped dies. |
| 24 | 16777216 | AF_ABORT_ON_WEAPON_DAMAGE | Stops on weapon damage. |
| 25 | 33554432 | AF_DISABLE_FORCED_PHYSICS_UPDATE | Skips the forced physics update at start. |
| 26 | 67108864 | AF_PROCESS_ATTACHMENTS_ON_START | Updates attached props on the first frame. |
| 27 | 134217728 | AF_EXPAND_PED_CAPSULE_FROM_SKELETON | Grows the capsule to fit the pose. |
| 28 | 268435456 | AF_USE_ALTERNATIVE_FP_ANIM | Uses the first-person variant if one exists. |
| 29 | 536870912 | AF_BLENDOUT_WRT_LAST_FRAME | Blend out finishes exactly at the last frame. |
| 30 | 1073741824 | AF_USE_FULL_BLENDING | Blends every bone fully. |
Older names from the first calculators (ANIM_FLAG_REPEAT, ANIM_FLAG_STOP_LAST_FRAME, ANIM_FLAG_UPPERBODY, ANIM_FLAG_ENABLE_PLAYER_CONTROL) are shown in the tool as “Also known as” on bits 0, 1, 4 and 5.
Presets
| Preset | Value | Flags |
|---|---|---|
| Play once | 0 | none |
| Loop | 1 | AF_LOOPING |
| Freeze at end | 2 | AF_HOLD_LAST_FRAME |
| Upper body once | 16 | AF_UPPERBODY |
| Upper body, can move | 48 | AF_UPPERBODY, AF_SECONDARY |
| Upper body loop, can move | 49 | AF_LOOPING, AF_UPPERBODY, AF_SECONDARY |
| Upper body hold, can move | 50 | AF_HOLD_LAST_FRAME, AF_UPPERBODY, AF_SECONDARY |
| Loop, can move | 51 | bits 0, 1, 4, 5 |
| Loop, stop when moving | 129 | AF_LOOPING, AF_ABORT_ON_PED_MOVEMENT |
| Cancelable | 120 | bits 3, 4, 5, 6 |
| Loop, no collision | 2561 | AF_LOOPING, AF_TURN_OFF_COLLISION, AF_IGNORE_GRAVITY |
TaskPlayAnim panel
| Option | What it does | Default |
|---|---|---|
| Example animations | Hands up, Arms crossed, Smoking, Cuffed, Wave, Triathlon idle. Sets dict, name and a fitting flag. | Hands up |
| Anim dictionary / Anim name | The clip to play. | missminuteman_1ig_2 / handsup_base |
| Blend in / Blend out | 1.0 is a slow blend, 8.0 is nearly instant. | 8.0 / 8.0 |
| Duration (ms) | -1 plays the whole clip, or forever when looping. |
-1 |
| Playback rate | Really the start phase, 0.0 to 1.0. | 0.0 |
| Lock X / Y / Z | Passes true for lockX, lockY and lockZ. |
off |
| /anim toggle command | Wraps it in a /anim command that starts or stops the clip. Off gives a plain CreateThread. |
on |
Example
The core of the generated snippet:
local function LoadAnimDict(dict)
if not DoesAnimDictExist(dict) then return false end
RequestAnimDict(dict)
local timeout = GetGameTimer() + 5000
while not HasAnimDictLoaded(dict) do
if GetGameTimer() > timeout then return false end
Wait(0)
end
return true
end
RegisterCommand("anim", function()
local ped = PlayerPedId()
local dict, name = "missminuteman_1ig_2", "handsup_base"
if IsEntityPlayingAnim(ped, dict, name, 3) then
StopAnimTask(ped, dict, name, 8.0)
elseif LoadAnimDict(dict) then
TaskPlayAnim(ped, dict, name, 8.0, 8.0, -1, 49, 0.0, false, false, false)
RemoveAnimDict(dict)
end
end, false)Tips
Tip
Upper body alone (16) still blocks walking. Add AF_SECONDARY (32) to let the player move while the clip plays.
- Stop a clip with
StopAnimTask(ped, dict, name, blendOut)orClearPedTasks(ped). RemoveAnimDictright after starting is fine: the running task keeps its own reference.- For sitting or lying on props, try the Loop, no collision preset.
- Bit 31 is not part of this enum, so the bit strip only shows bits 0 to 30.
Limitations
The tool does not check that a dictionary or clip name exists. The snippet does that at runtime with DoesAnimDictExist and a 5 second load timeout. Everything runs in the browser.
