FiveM Docs
Addons

esx_animations

esx_animations adds an emote menu to ESX Legacy with animations, scenarios and walk styles. Keybinds, Config.Animations format and GetConfig/SetConfig.

esx_animations is a client-side emote menu for ESX Legacy. Players open it with F3, pick a category and play an animation, a GTA scenario (smoking, fishing, taking photos) or a walking style. It ships with a NUI interface and can fall back to the classic esx_context menu.

Overview

Resourceesx_animations (version 1.1)
SideClient only (plus NUI)
Dependenciesesx_lib, es_extended; esx_context when Config.UseNui = false
SQL filenone
Commandsanimmenu (F3), cleartasks (Z)
Client exportsGetConfig, SetConfig

Installation

server.cfg
ensure es_extended
ensure esx_context
ensure esx_animations

No database changes are needed.

Usage in game

ActionDefault keyCommand
Open the menuF3/animmenu
Stop the animationZ/cleartasks

The keys are registered with RegisterKeyMapping, so each player can change them under Settings, Key Bindings, FiveM. The menu does not open while the player is dead. While the NUI is open, several controls (F2, F3, F4, F6, F7, Enter and exit vehicle) are disabled so other menus do not open behind it.

Configuration

KeyDefaultDescription
Config.LocaleGetConvar('esx:locale', 'en')Language of the NUI texts
Config.UseNuitruetrue uses the NUI menu, false uses the ESX context menu
Config.Animations8 categoriesThe menu content, see below

The default categories are festives, greetings, work, humors, sports, misc, attitudem (walk styles) and porn (adult gestures). Remove the last one if it does not fit your server.

Config.Animations format

config.lua
Config.Animations = {
    {
        name  = 'greetings',     -- unique id of the category
        label = 'Greetings',     -- shown in the menu
        items = {
            { label = 'Hello', type = 'anim', data = { lib = 'gestures@m@standing@casual', anim = 'gesture_hello' } },
            { label = 'Smoke', type = 'scenario', data = { anim = 'WORLD_HUMAN_SMOKING' } },
            { label = 'Confident', type = 'attitude', data = { lib = 'move_m@confident', anim = 'move_m@confident' } },
        }
    },
}
typedata fieldsWhat happens
animlib (animation dictionary), anim (clip name)Loads the dictionary and plays the clip once
scenarioanim (scenario name)Starts the scenario in place
attitudelib (clip set to load), anim (clip set to apply)Changes the walking style until it is changed again

Translations

The labels in config.lua are English. The localization folder contains complete replacement configs: br, cs, de, en, fi, it, nl, pl, ru, sl, sr and sv (for example de_config.lua). Copy the one you need over config.lua. The NUI language follows the esx:locale convar.

Client exports

GetConfig

local config = exports.esx_animations:GetConfig()

Returns the full Config table of the resource, including Config.Animations.

SetConfig

exports.esx_animations:SetConfig(newConfig)
NameTypeDescription
newConfigtableReplaces the whole Config table

SetConfig replaces the table instead of merging it, so always start from GetConfig():

client/main.lua
local config = exports.esx_animations:GetConfig()

config.Animations[#config.Animations + 1] = {
    name = 'gang',
    label = 'Gang',
    items = {
        { label = 'Lean on wall', type = 'scenario', data = { anim = 'WORLD_HUMAN_LEANING' } },
    }
}

exports.esx_animations:SetConfig(config)

The change is client-side only and lasts until the resource restarts. Run it on every client, for example on esx:playerLoaded.

Common issues

  • Animation does nothing: the dictionary or clip name is wrong. Check the name with a tool such as the FiveM natives reference or an animation list.
  • Walk style sticks after /cleartasks: walk styles are not tasks. Apply a different attitude entry, or call ResetPedMovementClipset in your own code.
  • Menu looks like the old ESX menu: Config.UseNui is false.

Frequently asked questions

Independent documentation

esx-fivem.com is a community project and is not affiliated with the ESX Framework team. Facts on this page were checked against the upstream source. Official resources: docs.esx-framework.org and github.com/esx-framework.
Edit on GitHub

Last updated on

On this page