Use it in game
Playing it in game
Unzip the download into a folder in resources, add one line to server.cfg and restart. Then type the chat command, or play it from your own script or menu.
Install the resource
Each AI Animations download is a zip named after the animation, for example hip_hop_step-inplace.zip and hip_hop_step-walk.zip. The files sit directly in the zip, without a folder around them.
- 1
Make a folder in resources
In your server's
resourcesdirectory, create a folder for the animation, for examplehip_hop_step. The folder name is up to you; it does not change the command. - 2
Unzip into it
Put the contents of the zip into that folder, so it holds
fxmanifest.lua,client.luaand thestreamfolder. - 3
Add it to server.cfg
Add one line with the folder name:
ensure hip_hop_stepFor the walking version, do the same with a second folder.
- 4
Restart the server
Restart the whole server and reconnect. Animations only register when the server starts; a resource restart or
refreshis not enough.
Command, dictionary and clip names
In an AI Animations resource, the animation dictionary and the clip carry the name of the animation, and the chat command is a slash plus the clip name. For the example:
In-place
Dictionary:hip_hop_stepClip name and command:hip_hop_stepLoop
Dictionary:hip_hop_stepClip name and command:hip_hop_step_crossfadePing-pong
Dictionary:hip_hop_stepClip name and command:hip_hop_step_pingpongWalking
Dictionary:hip_hop_step_moveClip name and command:hip_hop_step_move
So /hip_hop_step_crossfade in chat plays the loop clip.
The loop clips exist only when the animation was made or rebuilt with seamless loop. The result page lists the exact names of your animation under How to use it in-game.
In your own scripts
An AI Animations clip plays like any GTA animation. Load the dictionary, then start the clip on the ped. This is what the included client.lua does for the chat command:
local dict, clip = 'hip_hop_step', 'hip_hop_step_crossfade'
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do Wait(10) end
TaskPlayAnim(PlayerPedId(), dict, clip, 8.0, -8.0, -1, 1, 0, false, false, false)The 1 after -1 makes the clip repeat until the ped gets another task. Use 0 to play it once.
Emote menus and Menyoo
Any emote menu that takes a dictionary and a clip name can play AI Animations clips. In dpemotes and rpemotes, dances live in a Lua table in AnimationList.lua; add an entry with the dictionary, the clip and the label to show:
["hiphopstep"] = {"hip_hop_step", "hip_hop_step_crossfade", "Hip hop step", AnimationOptions = { EmoteLoop = true }},The key in square brackets is what players type after the emote command. The exact table name differs between menu versions, so add the entry next to the other dances.
For Menyoo, paste the line from the result page into menyooStuff/FavouriteAnims.xml, then play it from Player Options, Animations, Favourites:
<Anim dict="hip_hop_step" name="hip_hop_step_crossfade" />Note
The animation only exists on a FiveM server that runs the resource. If Menyoo does not start it, type the chat command once to load it, then try again.