> For the complete documentation index, see [llms.txt](https://gw-studio-1.gitbook.io/installation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gw-studio-1.gitbook.io/installation/gw-multi-job-install.md).

# Gw Multi Job Install

Welcome to the installation guide for the **GW Multijob** script. This script is designed to link Discord roles to in-game jobs automatically, providing a seamless multi-job management experience for your players.

***

## 🛠️ Dependencies

Ensure the following resources are installed and running correctly on your server:

* **vorp\_core**
* **vorp\_character**
* **oxmysql**

***

## 📥 Installation Steps

{% stepper %}
{% step %}

### Place the Resource

* Extract the folder and place it in your `resources` directory.
* **CRITICAL:** The folder name MUST be `gw_multijob` for the script to function correctly due to built-in protection.
  {% endstep %}

{% step %}

### Discord Bot Setup

The script requires a Discord bot to fetch player roles. Follow these steps:

1. Open [server\_config.lua](broken://pages/2c9193aa64a815beebf38f92764d1f25d7f4bf14).
2. Paste your bot's token into `ServerConfig.DiscordBot.BotToken`.
3. Paste your Discord Server ID into `ServerConfig.DiscordBot.GuildId`.
4. **Important:** Enable the `Server Members Intent` in your bot's settings on the [Discord Developer Portal](https://discord.com/developers/applications).
   {% endstep %}

{% step %}

### Job Mapping

1. Open [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3).
2. Locate the `Config.DiscordRoleToJob` table.
3. Add your Discord **Role IDs** and map them to the corresponding in-game job and grade:

{% code title="config.lua" %}

```lua
["123456789012345678"] = {job = "police", grade = 2}, -- Example: Deputy Sheriff
```

{% endcode %}
{% endstep %}

{% step %}

### Server Activation

* Add the following line to your `server.cfg`:

{% code title="server.cfg" %}

```cfg
ensure gw_multijob
```

{% endcode %}
{% endstep %}
{% endstepper %}

***

## ⚙️ Configuration

### [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3)

* **Config.Command**: The command used to open the menu (Default: `/job`).
* **Config.UI**: Customize colors, titles, and fonts to match your server's branding.

### [server\_config.lua](broken://pages/2c9193aa64a815beebf38f92764d1f25d7f4bf14)

* Contains sensitive bot credentials. **Never share this file** as it contains your private token.

***

## 🎮 How to Use

1. Ensure you have the required role assigned to you on Discord.
2. In-game, type the command `/job` (or your custom command).
3. The menu will display all jobs available to you based on your Discord roles.
4. Select a job to switch instantly. Your job and grade will be updated in the database.

***

## 🆘 Troubleshooting (FAQ)

<details>

<summary>Q: The menu won't open. What's wrong?</summary>

* Verify the folder name is exactly `gw_multijob`.
* Check if your Discord ID is correctly linked to your game identifier.

</details>

<details>

<summary>Q: I don't see all my jobs?</summary>

* Ensure the Role IDs in [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3) match your Discord roles perfectly.
* Make sure the bot is present in your Discord server and has the necessary permissions.

</details>

***

{% hint style="info" %}
To achieve a premium look, use coordinated HEX color codes in the UI settings inside [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3).
{% endhint %}
