Tebex Implementation
This guide will walk you through configuring your FiveM CoinSystem script to work with Tebex. Follow the steps below to set up and manage your in-game currency purchases through Tebex.
Step 1: Add Your Tebex Secret Keyβ
-
Open
sky_coinsystem/config/config.json
. -
Add your Tebex secret key in the
tebexSecretKey
field:"tebexSecretKey": "",
How to Find Your Tebex Secret Keyβ
-
Create a Game Server on Tebex: If you haven't already created a game server, you can do so by heading over to Game Servers > Connect Game Server. Or use this link to be taken to the correct page.
-
Login to Your Control Panel:
- Click Game Servers on the left-hand navigation menu.
- Click the server you want to find the secret key for.
- Click Show on the Secret Key.
Step 2: Configure Tebex Plusβ
If you are not using Tebex Plus, set the following field to false
in sky_coinsystem/config/config.json
:
"tebexPlus": false,
Noteβ
You need Tebex Plus to list all purchases for the player to claim. Without Tebex Plus, players have to use their payment ID in the UI to claim their purchase.
Step 3: Create a Package on Tebexβ
Create a package for your coins on Tebex. Tebex will ask for a deliverable. For our script, it doesn't matter what you put there as it works with the FiveM account of the player and the Tebex API.
Suggested Deliverablesβ
-
Discord Actions: e.g., give the customer a role.
-
File Download: with instructions for the customer on how to claim. You can add a text file with instructions like:
Thank you for your purchase!
Please make sure you are logged into FiveM with the same CFX account you used to buy the package.
If the package is not listed, you can claim it using the code field with your payment ID.
Step 4: Add Your Package to the Configurationβ
Add your package to the config/packages.json
file with the exact same name as in Tebex. This is important for proper synchronization.
Example:
{
"packages": [
{
"exactPackageName": "80 Coins",
"coinAmount": 80
},
{
"exactPackageName": "120 Coins",
"coinAmount": 120
}
]
}
Tutorial Videoβ
For a visual guide on the entire process, refer to this YouTube tutorial.
Possible Problemsβ
Issue: Players Can Claim All Their Purchases Again After Server Resetβ
- Solution: If you have a backup of your database, restore the
redeemed_payments
table. If not, use another package name in Tebex and in thepackages.json
to make old purchases unclaimable.
Issue: Players Don't See Their Purchased Rewards Listed in the UIβ
- Solution: Ensure the player is logged in with the same CFX account in FiveM as they bought the package with. Alternatively, they can use the payment ID to claim the reward. Note that you need Tebex Plus for the listing feature.
Alternative Methods for Giving Coinsβ
If you do not want to use Tebex, there are alternative ways to give coins:
- Generate Claimable Codes: Use the command
/gencode [coin_amount]
. The code will be shown as a notification and can be found in your database tableredeem_codes
. - Direct Coin Transfer: Use the command
/givecoins [id] [amount]
. - Integrate with Other Scripts: Use exports as documented here.
Follow these steps to ensure a smooth setup and management of your FiveM CoinSystem script with Tebex.