# Tebex

> The VIP store uses Tokens as currency. Players can buy Token packages from your Tebex store and redeem their Transaction IDs in-game. \
> This guide helps you connect your Tebex packages to the script for seamless redemption.

{% hint style="warning" %}
Your **Tebex Store should be already linked and working with your server**, is on YOU to connect it, read and follow the Tebex guide for this. \
<https://www.youtube.com/watch?v=it-eiJDwV5E>
{% endhint %}

### Package Properties

> Create a new Package in your Tebex Store, for this example we are creating a package equivalent to **50 tokens**.

* Setup your package title, description, thumbnail, category, price, etc.
* In the bottom actions select Game Server Commands

<figure><img src="/files/MFG9rAKbkOrpf5gtiY1a" alt=""><figcaption></figcaption></figure>

* Select your Game Server from the dropdown menu and in the command line click the Settings Button in the right side to display more options.

<figure><img src="/files/KhNNd9aDUQAicsUxEBPa" alt=""><figcaption></figcaption></figure>

* Make sure the command is triggered only **When the package is purchased**.
* **Require player to be online:** Set this option to "Execute command even if the player is offline".
  * If you don't change this, the command will never be triggered on your server and you will need to trigger it from your Tebex panel manually.
* The command to trigger should be **tokens (amount to add) {transaction}**

```
tokens 50 {transaction}
```

* **tokens:** This is the command the console will execute when the package is purchased, this should match your Config.TebexCommand in config/\_config.lua
* **amount:** The amount of tokens to add, that depends on your Tebex package, for this example we are adding 50 tokens.
* **transaction:** This is the Tebex Transaction ID, make sure is written as {transaction}, Tebex will replace it with the actual Transaction ID.

Once everything is setup you can save and publish your package.

### How to Redeem

* Once your players make a purchase of tokens from your Tebex Store, they will see this page where an unique Tebex Transaction ID is generated (they also receive it in their email):

```
tbx-4902525a16304-b0f69b
```

<figure><img src="/files/OsAKmPvM1ayzoNJbEKSH" alt=""><figcaption></figcaption></figure>

* This Transaction ID and the amount of tokens will be saved into the vip\_codes table in your Database:

<figure><img src="/files/Q220NoaOwyIQPKdNY6AH" alt=""><figcaption></figcaption></figure>

* You will also receive a Discord notification for the transaction:

<figure><img src="/files/l8NIiavY7pKhfzhJ33ng" alt=""><figcaption></figcaption></figure>

* The player can now redeem the code from the VIP panel:

<figure><img src="/files/2b3tI3L4tewg9iu3xXvJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/iLEHe2wO37LKSEFVVqOG" alt=""><figcaption></figcaption></figure>

* You will receive a new Discord notification with the info of who redeemed the code, how many tokens where added and his current tokens balance.

<figure><img src="/files/iRoKomrpkuEJIntyaorr" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Tebex can take up to 5 mins to process the purchase and trigger the server command, please be patience. Your server needs to be online and running, otherwise you will need to manually resend the game commands from your Tebex panel.
{% endhint %}


---

# 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://docs.av-scripts.com/guides/vip-script/tebex.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.
