Installation

Basic & simple installation instructions for the coinShop

  1. Make sure all dependencies are installed and running!

  2. Install and run coins.sql found in the directory.

  3. Head into configuration.lua and ensure that framework is set to ESX like so:

Framework = 'ESX',
  1. With the framework installed and set up, the rest is easy! Firstly, let's customize the coin shop. To do this, go to configuration.lua, where you'll find options under Customization to set up the shop to your liking, like the following:

    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 ]]
    },
  1. In addition there are some other cool features within the configuration file such as functions for when a player enter/exits the coin shop, notification system, cooldowns and many more. However lets get on to adding items & categories to your coin shop!

  1. Adding items & categories may seem complicated at first, however we can assure you that it gets very easy when understood.

  2. So firstly to add a category you head into data/data.lua once opened you will see a preset of categories which gives a good example of how to add another one, for example if i wanted to add a category named "Bundles" to the coin shop i will do the following:

        ['Categories'] = {
            { Label = 'VEHICLES' },
            { Label = 'ITEMS' },
            { Label = 'WEAPONS' },
            { Label = 'MONEY' },
            { Label = 'BUNDLES' }, -- My new category 
        },

    A restart of the resource is required for it to display!

  3. Now that we have added a category lets add an item.

  4. Firstly before we add an item, there are a few important functions that you need to learn before doing so, Here are the functions, with an explanation

Function
Explanation
Example of use
giveItem()

This will give the player any item of choice

giveItem({
   item = 'laptop',
   count = 2,
})
giveMoney()

This will give the player money to the account given such as (money, bank, black_money)

giveMoney({
   account = 'money',
   money = 1000000,
})
giveWeapon()

This will give the player a weapon and ammo

giveWeapon({
   weapon = 'WEAPON_APPISTOL',
   ammo = 200,
})
giveVehicle()

This will give the player a vehicle with an option just to spawn or put in there garage or both

giveVehicle({
   model = 'adder',
   spawn = true,
   save = true,
})
  1. Now that you have learned the functions lets put them to use.

  2. To add an item we simply add them to the items table:

    ['Items'] = {
    }

  3. Heres an example of me adding an item:

['Items'] = {
    {
        Label = 'Example Bundle', -- Label of the item
        Category = 'BUNDLES', --[[
            Like shown above when adding a category put the label of the
            desired category you want to add the item to here.
        ]]
        Coins = 5000, -- How much does the item cost?
        Sale = '50', -- Set to '0' if you dont want a sale
        Image = 'https://www.fivemanage.com/upload' -- Your image link
        Role = false, --[[ 
            Check if they have a discord role or just set it false
            Example: Role = 'ROLE DISCORD ID',
        ]] 
        onPurchase = function(data)
           -- This will be executed when they purchase the item
        end
    }, -- Make sure to always remember to add a comma!!!!!
    
    -- To create another item make sure u stay inside ['Items'] for example:

    {
        -- Your new item here
    }, -- Make sure to always remember to add a comma!!!!!

}
  1. Now that you have hopefully undersood how to add an item! Lets put the functions given above in the table to use!

  2. In addition you dont have to use the functions, you can do anything you want inside of it, however we recommend using the functions given!

  3. To use the functions it is pretty simple, lets say i want to give the player a vehicle, such as a Trackhawk (make sure this is a car model) and want it to spawn on them and also save in there garage, you can do the following:

{
    Label = 'Example Bundle', -- Label of the item
    Category = 'BUNDLES', --[[
        Like shown above when adding a category put the label of the
        desired category you want to add the item to here.
    ]]
    Coins = 5000, -- How much does the item cost?
    Sale = '50', -- Set to '0' if you dont want a sale
    Image = 'https://your_image_link.png' -- Your image link
    Role = false, --[[ 
        Check if they have a discord role or just set it false
        Example: Role = 'ROLE DISCORD ID',
    ]] 
    onPurchase = function(data)
        giveVehicle({
            model = 'Trackhawk', -- 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?
        })
    end
}, -- make sure to always remember to add a comma!!!!!
  1. So now you have seen how to use a function we suggest experimenting your self with all of them so you know how they work!

  2. Always make sure the Category matches one of your categories!

  3. FivemManage is a very useful cloud manager for your images! (Not Partnered)

  4. Now that you have added your categories and items its time for integration

Last updated