# Tebex Integration

### 1. Create a Game Server

1. Go to [creator.tebex.io](https://creator.tebex.io) and log into your store.
2. In the left sidebar, navigate to **Integrations → Game Servers**.
3. Click **Add Server** and select **FiveM** as the game type.
4. Copy the **secret key** provided and add it to your `server.cfg`:

```cfg
set sv_tebexSecret "YOUR_SECRET_KEY_HERE"
```

5. Restart your server. Once verified, the server status will show **Connected**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note:</strong> The secret key links your Tebex store to your FiveM server. Never share it publicly.</p></div>

***

### 2. Create a Package

1. In your Tebex dashboard go to **Packages → New Package**.
2. Fill in the package **name**, **description**, and set the **category** to `Scripts`.
3. Under **Pricing**, set your price in EUR.
4. Set **Recurring Payment** to **Only charge the customer once**.
5. Save the package draft before adding deliverables.

***

### 3. Add FiveM Asset Delivery

1. In the package editor, scroll to the deliverables section and click **Add Deliverable → FiveM Asset**.
2. Under **FiveM Assets**, search for your escrow-protected resource and select it.
3. The asset tag will appear as:

{% hint style="info" %}
\*\*Note:\*\* Your script must be submitted to the \*\*Cfx.re Asset Escrow\*\* system before it appears here. Upload it at \[keymaster.fivem.net]\(<https://keymaster.fivem.net>) first.
{% endhint %}

***

### 4. Add Game Server Commands

1. In the same package, click **Add Deliverable → Game Server Commands**.
2. In the **Game Servers** dropdown, select your connected server.
3. Click **Add Command** and set the trigger to **When the package is purchased**.
4. Enter your command using the `{transaction}` variable:

```
tebex_command_ars_yourscript-give-slot {transaction}
```

<figure><img src="https://3126850896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0z1C0KvxmNsrs0x7GCbK%2Fuploads%2FlewB5ziq5Ev0jvZtBVhI%2Fimage.png?alt=media&#x26;token=b396781b-d089-4ed8-b4ce-99950225b347" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3126850896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0z1C0KvxmNsrs0x7GCbK%2Fuploads%2FiZvupe6CgikvZen5yHub%2Fimage.png?alt=media&#x26;token=755bd3d5-0b85-45d3-a9db-417dc0bc6270" alt=""><figcaption></figcaption></figure>
