Page cover

Tebex & VIP Shop

Here you can find the installation for cas-vip script.

About Script

Introducing the VIP Script for RedM, a feature-rich system where players can purchase in-game coins using real money. After receiving a transaction code, they can redeem it in-game to unlock a variety of rewards, such as exclusive items, in-game currency, and other exciting perks.

The script boasts an elegant and intuitive user interface, ensuring a seamless experience for players. Setting it up is incredibly simple, making it accessible for server owners without complex configurations. This VIP system is perfect for enhancing player engagement while providing a smooth monetization solution.

Installation

API Reference

Below is a detailed reference for each available function.

GetCoins

Retrieves the current VIP coin balance for a specific player. This is a read-only operation.

local balance = VIP:GetCoins(source)

Parameters

Parameter

Type

Description

source

number

The server ID of the player whose balance you want to check.

Returns

  • number: The player's current coin balance. Returns 0 if the player is not found or has no coin record.

Example

local playerSource = source
local currentCoins = VIP:GetCoins(playerSource)
print("Player " .. GetPlayerName(playerSource) .. " has " .. currentCoins .. " VIP coins.")

HasCoins

Checks if a player has a sufficient amount of VIP coins. Useful for verifying a purchase before proceeding.

local hasEnough = VIP:HasCoins(source, amount)

Parameters

Parameter

Type

Description

source

number

The server ID of the player.

amount

number

The amount of coins to check for. Must be a positive number.

Returns

  • boolean: Returns true if the player's balance is greater than or equal to the specified amount, otherwise false.

Example

local playerSource = source
local itemPrice = 100

if VIP:HasCoins(playerSource, itemPrice) then
    print("Player has enough coins to make the purchase.")
else
    print("Player does not have enough coins.")
end

RemoveCoins

Removes a specified amount of coins from a player's balance. This function should be used for all purchases or coin deductions.

local success = VIP:RemoveCoins(source, amount, reason)

Parameters

Parameter

Type

Description

source

number

The server ID of the player.

amount

number

The amount of coins to remove. Must be a positive number.

reason

string

(Optional) A brief description of the transaction for logging purposes (e.g., "Purchased a Golden Pet").

Returns

  • boolean: Returns true on successful removal, or false if the player did not have enough coins or the amount was invalid.

Note: This function is fully integrated with the system's logging. Every successful transaction is automatically logged to the configured Discord webhook and synchronized with the database.

Example

local playerSource = source
local petPrice = 50

local success = VIP:RemoveCoins(playerSource, petPrice, "Purchase of a new pet")
if success then
    -- Logic to give the pet to the player
    print("Successfully charged player for a new pet.")
end

AddCoins

Adds a specified amount of coins to a player's balance. This function should be used for all rewards or coin additions.

local newBalance = VIP:AddCoins(source, amount, reason)

Parameters

Parameter

Type

Description

source

number

The server ID of the player.

amount

number

The amount of coins to add. Must be a positive number.

reason

string

(Optional) A brief description of the transaction for logging purposes (e.g., "Reward for completing a quest").

Returns

  • number or false: Returns the player's new balance on success, or false if the amount was invalid.

Note: Similar to RemoveCoins, this function automatically handles Discord logging and database synchronization.

Example

local playerSource = source
local questReward = 25

local newTotal = VIP:AddCoins(playerSource, questReward, "Reward for the 'Lost & Found' quest")
if newTotal then
    print("Player now has " .. newTotal .. " coins.")
end

Tebex Installation Step - 1

  • First click on Integrations/Game servers nav button.

Step - 2

Click Connect Game Server button.

Step - 3

Select "Plugin" and click Continue button.

Step - 4

Select your package and click "Continue" button.

Step - 5

Copy your tebex key and click continue.

Step - 6

Click packages nav button.

Step - 7

Click Add New and select package nav.

Step - 8

Fill the all blanks.

Step - 9

Click "Game Server Commands" and set the settings package and fill the command blank command: tbxcoin {transaction} coinAmount

Coin Amount must be number. Write how many coins you want the package to give to the person

Configuration

Last updated