Configuration

Here you can find a preview of the configuration given, bare in mind that there maybe a few additional configuration files that are not displayed here!

Configuration:

Configuration = {
    Framework = 'ESX', ---@type "ESX" | "QB" | "Standalone" --Export can be adjusted in server/source/source.lua
    Debug = true,--[[
    Recommended to leave true ]]

    RedeemCooldown = 10, -- Prevents spamming a non existent redeem code

    ---@param message string
    notify = function(message)
        lib.notify({
            title = 'Coin System',
            description = message,
        })
    end,

    enterShop = function()
        DisplayRadar(false)
        -- This function will be executed when the coin shop is opened
        -- example of usage: exports['hudScript']:hideHud()
    end,

    exitShop = function()
        DisplayRadar(true)
        -- This function will be executed when the coin shop is closed
        -- example of usage: exports['hudScript']:showHud()
    end,

    Command = {
        Enabled = true, 
        Command = 'cs' --[[
        Change the command to your liking or just disable it ]]
    },

    Customization = {
        Theme = 'rgba(238, 175, 41, .9)',
        Store = 'https://beyond.tebex.io',
        Discord = 'https://discord.gg/beyondstudios', 
        Logo = 'https://r2.fivemanage.com/pub/g0gmeqg1xagc.png'--[[
        Customization for the coin shop ]]
    },
}

Data:

Data = {
    -- Feel free to add as many categories as you desire :D
    ['Categories'] = {
        { Label = 'VEHICLES' },
        { Label = 'ITEMS' },
        { Label = 'WEAPONS' },
        { Label = 'MONEY' },
    },

    ['Items'] = {
        { 
            Label = 'NCS BMW', -- item label
            Category = 'VEHICLES', -- category for the item
            Coins = 20, -- how many coins needed to purchase
            Sale = '50', -- if you dont want a sale then set to 0 (will take a % off when above)
            Image = 'https://r2.fivemanage.com/pub/4nmqj93682vh.png', -- image for the item
            Role = '1140475039343460414', -- do you want it so you need to have a discord role when purchasing
            AutoClose = true, -- will automatically close the shop when purchased

            ---@param data table 
            --- All above is included in data for example: data.Label, data.Category, data.Coins etc.
            onPurchase = function(data)

                giveVehicle({
                    model = 'adder', -- model of the vehicle 
                    spawn = true, -- do you want the vehicle to spawn on the player?
                    save = true -- do you want the vehicle to save in the players garage?
                })
                
                Configuration.notify('This new vehicle seems super cool')
            end
        },
        { 
            Label = '18 Performance', 
            Category = 'VEHICLES', 
            Coins = 2000, 
            Sale = '50', 
            Image = 'https://r2.fivemanage.com/pub/4nmqj93682vh.png',
            AutoClose = true,
            onPurchase = function(data)

                giveVehicle({
                    model = 'adder', -- model of the vehicle 
                    spawn = true, -- do you want the vehicle to spawn on the player?
                    save = true -- do you want the vehicle to save in the players garage?
                })

                Configuration.notify('This new vehicle seems super cool')
            end
        },
        { 
            Label = '16 Charger', 
            Category = 'VEHICLES', 
            Coins = 2000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/4nmqj93682vh.png',
            AutoClose = true,
            onPurchase = function(data)

                giveVehicle({
                    model = 'adder', -- model of the vehicle 
                    spawn = true, -- do you want the vehicle to spawn on the player?
                    save = true -- do you want the vehicle to save in the players garage?
                })
                
                Configuration.notify('This new vehicle seems super cool')
            end
        },
        { 
            Label = 'LAPTOP', 
            Category = 'ITEMS', 
            Coins = 10000, 
            Sale = '50', 
            Image = 'https://r2.fivemanage.com/pub/237tvzs29uls.png',
            AutoClose = true,
            onPurchase = function(data)

                giveItem({
                    item = 'laptop', -- item name you want to give to the player
                    count = 2, -- how many of the item do you want to give?
                })

                Configuration.notify('This new laptop seems super cool')
            end
        },
        { 
            Label = 'FORTNITE AR', 
            Category = 'WEAPONS', 
            Coins = 2000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/bd8ufsdladi9.png',
            AutoClose = true,
            onPurchase = function(data)

                giveWeapon({
                    weapon = 'WEAPON_COMBATPISTOL', -- the weapon id you want to give the player (https://wiki.rage.mp/index.php?title=Weapons)
                    ammo = 200 -- the ammo you want to give inside the gun
                })

                Configuration.notify('This new combat pistol seems super cool')
            end
        },
        { 
            Label = 'FORTNITE SCAR', 
            Category = 'WEAPONS', 
            Coins = 5000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/bd8ufsdladi9.png',
            onPurchase = function(data)

                giveWeapon({
                    weapon = 'WEAPON_APPISTOL', -- the weapon id you want to give the player (https://wiki.rage.mp/index.php?title=Weapons)
                    ammo = 200 -- the ammo you want to give inside the gun
                })

                
                Configuration.notify('This new combat appistol seems super cool')
            end
        },
        { 
            Label = '$1,000,000', 
            Category = 'MONEY', 
            Coins = 1000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/0a3tyo59gc79.png',
            AutoClose = true,
            onPurchase = function(data)

                giveMoney({
                    account = 'money', -- the account you want to give the money in (money/bank/black_money)
                    money = 1000000 -- the amount of money you want to give
                })

                Configuration.notify('WOW thats a lot of money, this is dope!')
            end
        },
        { 
            Label = '$5,000,000', 
            Category = 'MONEY', 
            Coins = 5000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/0a3tyo59gc79.png',
            onPurchase = function(data)
                
                giveMoney({
                    account = 'money', -- the account you want to give the money in (money/bank/black_money)
                    money = 5000000 -- the amount of money you want to give
                })

                Configuration.notify('WOW thats a lot of money, this is dope!')
            end
        },
        { 
            Label = '$10,000,000', 
            Category = 'MONEY', 
            Coins = 9000, 
            Sale = '0', 
            Image = 'https://r2.fivemanage.com/pub/0a3tyo59gc79.png',
            AutoClose = true,
            onPurchase = function(data)

                giveMoney({
                    account = 'money', -- the account you want to give the money in (money/bank/black_money)
                    money = 10000000 -- the amount of money you want to give
                })

                Configuration.notify('WOW thats a lot of money, this is dope!')
            end
        },
        { 
            Label = '$15,000,000', 
            Category = 'MONEY', 
            Coins = 12000, 
            Sale = '20', 
            Image = 'https://r2.fivemanage.com/pub/0a3tyo59gc79.png',
            AutoClose = true,
            onPurchase = function(data)

                giveMoney({
                    account = 'money', -- the account you want to give the money in (money/bank/black_money)
                    money = 15000000 -- the amount of money you want to give
                })

                Configuration.notify('WOW thats a lot of money, this is dope!')
            end
        },
    }
}

Integration:

-- @Tebex integration
-- The first box is for the Tebex package name, and the number is how many coins they should get for it
Tebex = {
    ['100 Coins'] = 100,  -- Package name: 'Gang Leaderboard', Coins: 2000
    ['500 Coins'] = 500,  
}

-- @Discord integration
-- This is only required if you are checking the players roles and using the role feature for a package 
Discord = {
    BotToken = '',
    GuildID = '',
    Commands = ''
}

-- These will send a log to the webhook given so you can keep a close eye on whos buying and redeeming, very useful!
Webhooks = {
    Purchase = '',
    Redeem = '',
    Tebex = '',
    Commands = ''
}

Language:

Language = {
    ['cooldown'] = 'Please wait before performing this action again!',
    ['invalid_code'] = 'This code does not exist! Please contact the owners if you think this is a mistake!',
    ['valid_code'] = 'WOW! You have just received %d coins ✨',
    ['not_enough_coins'] = 'You do not have enough coins to purchase this item!',
    ['no_role'] = 'You do not have the role required to purchase this item!'
 }

Last updated