# Adding New Animations

#### **How to Add New Animations in FiveM**

In FiveM, custom animations can be added to your server by modifying specific fields in a configuration file. Below is a detailed explanation of how to add new animations, using the example provided:

***

#### **Key Components for Adding Animations:**

Each animation is defined by the following fields:

* **`anim`**: The name of the animation file.
* **`label`**: The label that will appear in the menu for this animation.
* **`gif`**: The image or GIF to be shown for the animation in the menu.
* **`dict`**: The animation dictionary where the animation resides.
* **`animSettings`**: Optional settings like looping, speed, etc. (e.g., "EmoteLoop": true).
* **`category`**: The category this animation belongs to (e.g., "custom").
* **`id`**: The unique identifier for the animation, which is used to call the animation.

***

#### **Steps to Add a New Animation:**

1. **Choose an Animation**\
   Find or create the animation you want to add. This could be any custom animation file or an existing one.
2. **Open Animation File**\
   Open cylex\_animmenuv2/animations/AnimationList.json
3. **Add New Entry to Configuration**\
   To add a new animation, simply add a new block to the configuration file with the following fields:

   ```json
   "newanim": {
       "anim": "new_anim_name",
       "label": "New Animation Label",
       "gif": "new_animation.gif",
       "dict": "new_animation_dict",
       "animSettings": {
           "EmoteLoop": false
       },
       "category": "custom",
       "id": "newanim"
   }
   ```

   Replace the placeholders with your new animation details:

   * `"anim"`: The name of your animation file (e.g., `"new_anim_name"`).
   * `"label"`: The name that will appear in the menu for users (e.g., `"New Animation Label"`).
   * `"gif"`: The name of the image or GIF associated with the animation in the menu (e.g., `"new_animation.gif"`).
   * `"dict"`: The animation dictionary name (e.g., `"new_animation_dict"`).
   * `"animSettings"`: Add settings such as `EmoteLoop` or any other settings relevant to your animation.
   * `"category"`: This is typically `"custom"`, but you can change it if you have different categories.
   * `"id"`: A unique identifier for your animation (e.g., `"newanim"`), which will be used when calling the animation.
4. **Test the Animation**\
   After adding the animation to your configuration file, ensure the animation is accessible through the in-game menu. You can call the animation using the assigned ID, for example:

   ```lua
   /e newanim
   ```
5. **Adjust as Needed**\
   If the animation is not working as expected (e.g., incorrect playback speed, looping, etc.), revisit the `animSettings` and `dict` values to fine-tune the configuration.

***

#### **Example:**

If you wanted to add a "wave" animation to your server, you would modify the configuration like this:

```json
"wave": {
    "anim": "wave01",
    "label": "Wave",
    "gif": "wave.gif",
    "dict": "anim@wave@solo",
    "animSettings": {
        "EmoteLoop": true
    },
    "category": "custom",
    "id": "wave"
}
```

* `"anim"` is `"wave01"`, the name of the animation file.
* `"label"` is `"Wave"`, which will be shown in the menu.
* `"gif"` is `"wave.gif"`, an image or GIF shown for the animation.
* `"dict"` is `"anim@wave@solo"`, the dictionary the animation belongs to.
* `"animSettings"` includes `EmoteLoop` set to `true`, so the animation will repeat.
* `"category"` is `"custom"`, indicating the animation is custom.
* `"id"` is `"wave"`, the unique ID for calling the animation.

***

By following these steps, you can easily add custom animations to your server, making the gameplay experience more dynamic and interactive for your players.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cylexdev.gitbook.io/docs/cylex-animmenuv2/adding-new-animations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
