[PAID] Advanced Crafting System - Ron Scripts

A script by marquesjx

No reviews yet.
[PAID] Advanced Crafting System - Ron Scripts main image

Full Description

Description

Crafting script that allows you to craft weapons and other items in unique way,
Add a lot of role play to your server and challenge for your server players to get weapons.

No obfuscation!
Without IP Lock!
Full source code!


Frameworks

● QBCore
● ESX

Features

UI:
Modern and unique UI, responsive for every screen.

OPTIMIZED:
The script will not take more than 0.01 MS effort when you are not near the craft location.

CATEGORIES & WEAPONS:
Option to add infinity categories/weapons for crafting.

Config
Config = {}
Config.Core = {
  name = "ESX",
  gettingCoreObject = "event", -- event/export
  gettingObjectName = "esx:getSharedObject", -- the event name / export name for getting the core object.
  core_resource_name = "es_extended" -- the core resource name.
}

Config.Coords = {coords = vector3(322.3, -305.2, 52.2), heading = 222}

Config.craftResources = {
    item1 = {
        name = "", -- The name of the item.
        label = "Pistol Loop", -- The label of the item.
        image = "rn-crafting/ui/images/snspistol_part_1.png" -- The direction of the image.
    },
    item2 = {
        name = "",
        label = "Pistol Trigger",
        image = "rn-crafting/ui/images/snspistol_part_2.png"
    },
    item3 = {
        name = "",
        label = "Pistol Clip",
        image = "rn-crafting/ui/images/snspistol_part_3.png"
    },
    item4 = {
        name = "",
        label = "Pistol Body",
        image = "rn-crafting/ui/images/snspistol_stage_1.png"
    },
}

Config.Crafting = {
    categories = {
        {
            item = "pistol", -- The name of the weapon category. Example in this config we have this categories: default, pistol, smg, rifle.
            itemName = "", -- The name of the item that required to be in the inventory to open the category.
            itemlabel = "Pistols", -- The label of the item.
            itemImg = "rn-crafting/ui/images/combatpistol.png" -- The name of the image(In the inventory). Example: pistol50.png => pistol50.
        },
        {
            item = "smg", 
            itemName = "",
            itemlabel = "SMG",
            itemImg = "rn-crafting/ui/images/smg.png"
        },
        {
            item = "rifle",
            itemName = "phone",
            itemlabel = "Rifles",
            itemImg = "rn-crafting/ui/images/assaultsmg.png"
        },
        {
            item = "explosive",
            itemName = "",
            itemlabel = "Explosives",
            itemImg = "rn-crafting/ui/images/molotov.png"
        },
    },
    --------------------------------------------------------------------------------------------------------------
    pistol = {
        {
            weaponName = "weapon_pistol", -- The name of the item.
            weaponLabel = "Colt 1911", -- The label of the item.
            weaponResources = {
                item1 = 9, -- The amount that should be in the inventory to build the weapon. the items from here: **Config.craftResources**
                item2 =  9,
                item3 =  9,
                item4 =  1
            },
            price = 2300 -- The price for crafting weapon.
        },
        {
            weaponName = "weapon_combatpistol",
            weaponLabel = "FNX 45",
            weaponResources = {
                item1 = 10,
                item2 =  10,
                item3 =  10,
                item4 =  1
            },
            price = 2800
        },
        {
            weaponName = "weapon_heavypistol",
            weaponLabel = "Heavy Pistol",
            weaponResources = {
                item1 = 18,
                item2 =  18,
                item3 =  18,
                item4 =  1
            },
            price = 3600
        },
        {
            weaponName = "weapon_appistol",
            weaponLabel = "AP Pistol",
            weaponResources = {
                item1 = 22,
                item2 =  20,
                item3 =  20,
                item4 =  1
            },
            price = 4000
        }
    },
    smg = {
        {
            weaponName = "weapon_microsmg",
            weaponLabel = "Micro SMG",
            weaponResources = {
                item1 = 22,
                item2 =  22,
                item3 =  22,
                item4 =  2
            },
            price = 6000
        },
        {
            weaponName = "weapon_minismg",
            weaponLabel = "Skorpion",
            weaponResources = {
                item1 = 24,
                item2 =  24,
                item3 =  24,
                item4 =  2
            },
            price = 6500
        },
        {
            weaponName = "weapon_machinepistol",
            weaponLabel = "Tec 9",
            weaponResources = {
                item1 = 28,
                item2 =  28,
                item3 =  28,
                item4 =  2
            },
            price = 7250
        }
    },
    rifle = {
        {}
    }
}

-- Server:
Config.GetPlayerMoney = function(playerId,Core)
    --[[
      This function is used for getting the player's money.
      Parameters:
        @playerId: The player server id/source.
        @Core: The current core object.
      
      Example for ESX implementation is down below.
    ]]
    local xPlayer = Core.GetPlayerFromId(playerId)
    if xPlayer then
        return xPlayer.getMoney()
    end
end
  
Config.RemovePlayerMoney = function(playerId, amount, Core)
    --[[
      This function is used for paying for the vehicle/testdrive.
      Parameters:
        @playerId: The player server id/source.
        @amount: the amount to pay.
        @Core: The current core object.
      
      Example for ESX implementation is down below.
      ]]
    local xPlayer = Core.GetPlayerFromId(playerId)
    if xPlayer then
        xPlayer.removeMoney(amount)
    end
end

Check Out Our Other Scripts