Skip to main content

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​

  1. Open sky_coinsystem/config/config.json.

  2. 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 the packages.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 table redeem_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.