How can I add animations to ESX jobs?

On some servers that I have played on in the past, they had it set up so when you do some of the standard ESX jobs, like Butcher for example, your character does an animation when you do certain things.

For example, if you did the Butcher Job, when you catch the live chickens, your character would bend over and look like they are grabbing at something. Then the same thing would happen when you slaughter and package the chickens.

I looked through the slaughterer.lua file in esx_jobs but can’t figure out how I would be able to trigger an animation when doing jobs.

Thanks in advance, any help will be greatly appreciated.

1 Like

You can use this snippet to add a animation to something.

local animdict = 'amb@prop_human_bum_bin@idle_b' --Dictionary of animation
local anim = 'idle_d" --Animation name
RequestAnimDict(animdict) -- request animation
while not HasAnimDictLoaded(animdict) do --make sure animation is loaded
    Wait(0)
end
TaskPlayAnim(PlayerPedId(), animdict, anim, 8.0, -8, -1, 49, 0, 0, 0, 0) --do animation

I would recommend putting this into the client.lua of your esx_jobs script.

3 Likes