# Tebex Authenticator

{% hint style="info" %}
Whenever possible, create packages of only the slots you will sell. Do not sell for slots that are already open.
{% endhint %}

***

### Connecting Tebex to the server

* Create a tebex account, login if you have
* After logging in to your account, let's go to the page called <mark style="background-color:orange;">"Game Servers"</mark> from the left side of the page.
* Click the <mark style="background-color:orange;">"CONNECT GAME SERVER"</mark> button at the top right of the page.
* Let's choose the place named <mark style="background-color:orange;">"PLUGIN"</mark> from the page that comes up and continue.
* Then let's choose your server name and in which packages these sales will be active, but <mark style="background-color:orange;">"SELECT ALL"</mark> will help you.
* After continuing, it will give you an <mark style="background-color:orange;">sv\_tebexSecret</mark> key on the page that opens in front of you, let's copy it and paste it anywhere in server.cfg, but let's make sure that this code is on the top lines. Then let's start the server.
* When you start the server, the text <mark style="background-color:red;">"NOT CONNECT"</mark> on the top right of the page will change to <mark style="background-color:orange;">"CONNECT"</mark> after a few seconds. After seeing this article, press the continue button and now there is a communication system between your server and tebex.

***

### Creating a Package Sending News to the Server

We have connected tebex with our server above, and now we will transfer the sales from tebex to the server instantly and make a system where the player can claim it.

* We click on the <mark style="background-color:orange;">"PACKAGES"</mark> section from the left side and we are directed to the page.
* Then we click on the <mark style="background-color:orange;">"ADD NEW"</mark> button on the top right of the page and choose the package option.
* On the page that opens before us, we enter the title of the product. This is very important because we will also use the product title you entered in the script, so be careful to write neat and plain text without emojis.
* After entering the other necessary information of the product, <mark style="background-color:red;">"Configure what your customers should receive upon purchasing this package"</mark>. We select the <mark style="background-color:orange;">"+GAME SERVER COMMANDS"</mark> option from the section.
* From the drop-down section, we choose the server name that we just created in the above steps. Then click the <mark style="background-color:orange;">"ADD COMMAND"</mark> button at the bottom.
* After clicking the button, we paste the following code in the "Enter the command to execute on your server" section. This code: <mark style="background-color:green;">tebex\_buypackage {"tid": "{transaction}", "mail": "{email}", "pname": "{packageName}", "price": "{price}"}</mark>
* After pasting the code, click the settings icon on the right. From this section, we select our server in the <mark style="background-color:red;">"Game server to Execute On"</mark> section. From the <mark style="background-color:orange;">"Require Player To Be Online"</mark> section, we select the "Execute the command even if the player is offline" option and create our package.
* Copy the product name you created. Find the TebexPack table and create a new table in it as follows:

```lua
Config.TebexPackages = { 
    -- Names of the packages created in Tebex. In order to find the purchased slot
    -- ["@string"] = @number
    -- ["Tebex Package Name"] = Number of the slot to be opened
    -- ["Make Sure You Spell The Package Name You Create Correctly!"] = Slot number to be opened after purchase,

    ["Multicharacter - Slot 1"] = 1,
    ["Multicharacter - Slot 2"] = 2,
    ["Multicharacter - Slot 3"] = 3,
    ["Multicharacter - Slot 4"] = 4,
    ["Multicharacter - Slot 5"] = 5,
}
```

***

{% hint style="danger" %}
**Open a different tebex pack for each slot.**
{% endhint %}
