đŸ”Ŧ
RX Scripts
STOREDISCORD
  • 👋Overview
  • Find us
    • 🔗Store
    • 🔗Discord
    • 🔗Youtube
  • 🌐Scripts
    • Garages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Reports PRO
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Mining
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Fishing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Player Stores
      • đŸ› ī¸Installation
      • 🚚Jobs DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Drug Labs
      • đŸ› ī¸Installation
      • âœˆī¸Operation DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Hunting
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Plantation
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Gang Wars
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Housing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Chopshop
      • đŸ› ī¸Installation
      • 📝Configurables
    • Death System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Recyclers
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Smelters
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Crates & Storages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Exports
      • â†Šī¸Events
    • Black Markets
      • đŸ› ī¸Installation
      • 📝Configurables
    • Hazard Zones
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Report System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Billing System
      • đŸ› ī¸Installation
      • â†Ēī¸Exports
      • â†Šī¸Events
Powered by GitBook
On this page
  • Config files
  • Opensource files
  1. Scripts
  2. Mining

Configurables

In this page, you can see everything that can be configured/changed within this script.

Config files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

--[[
    MINING ZONES CAN BE FOUND IN config/zones.lua
    ORES CAN BE FOUND IN config/ores.lua
    TOOLS CAN BE FOUND IN config/tools.lua
    LEVELS CAN BE FOUND IN config/levels.lua
    MISSIONS CAN BE FOUND IN config/missions.lua
    TRANSLATIONS CAN BE FOUND IN locales/*.lua

    IN HERE YOU CAN FIND THE MORE GENERIC / NOT VERY LONG LISTS CONFIGURATIONS
--]]

Config = {}

Config.SaveInterval = 10                         -- Minutes (Set to 'false' to disable saving on interval, only on server shutdown, or important reached levels)                       -- Discord webhook to send important logs (Set to '' to disable)
Config.Locale = 'en'
Config.ImgDirectory = 'ox_inventory/web/images/' -- The directory where the images are stored.
Config.Keybinds = {
    pile = 36, -- LEFT CTRL
}

Config.MiningLicense = {
    enabled = true, -- Set to false to disable the whole mining license
    buyable = true, -- Set to false to disable buying the license, use exports to give the license to a player
    price = 1500,
    moneyType = 'bank',
    restricts = {
        mining = true,    -- If true, mining without a license will notify the police and will give no benefits
        shopNPC = true,   -- If true, you need a mining license to open the shop NPC
        sellNPC = true,   -- If true, you need a mining license to open the sell NPC
        miningNPC = true, -- If true, you need a mining license to open the mining NPC
        vehicleRenting = true, -- If true, you need a mining license to rent a vehicle
    },
}

Config.MiningNPC = { -- NPC to buy mining license (if enabled) & see routes, level etc..
    enabled = true,  -- Set to false to disable the mining NPC
    coords = vector3(1078.8353, -1980.5603, 30.4708),
    heading = 190.3568,
    model = 's_m_y_construct_01',
    blip = {
        enabled = true,
        sprite = 124,
        color = 31,
        label = 'Bob The Miner',
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
}

Config.ShopNPC = {  -- NPC that opens a shop
    enabled = true, -- Set to false to disable the shop npc
    route = true,   -- If true, the shop NPC will have a route in the mining npc
    label = 'Mining Shop',
    moneyType = 'bank',
    model = 's_m_y_dockwork_01',
    coords = vector3(1078.0854, -1972.3464, 30.4707),
    heading = 196.7609,
    blip = {
        enabled = true,
        sprite = 124,
        color = 31,
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
    categories = {
        ['Pickaxes'] = {
            { item = 'stone_pickaxe',    amount = 1, price = 2500,  label = 'Stone Pickaxe',    requiredLevel = 0, mystery = false },
            { item = 'iron_pickaxe',     amount = 1, price = 5000,  label = 'Iron Pickaxe',     requiredLevel = 1, mystery = false },
            { item = 'steel_pickaxe',    amount = 1, price = 7500,  label = 'Steel Pickaxe',    requiredLevel = 3, mystery = false },
            { item = 'titanium_pickaxe', amount = 1, price = 10000, label = 'Titanium Pickaxe', requiredLevel = 4, mystery = false },
            { item = 'diamond_pickaxe',  amount = 1, price = 15000, label = 'Diamond Pickaxe',  requiredLevel = 5, mystery = true },
            { item = 'quantum_pickaxe',  amount = 1, price = 20000, label = 'Quantum Pickaxe',  requiredLevel = 6, mystery = true },
        },
        ['Drills'] = {
            { item = 'mining_drill', amount = 1, price = 50000,  label = 'Mining Drill', requiredLevel = 8,  mystery = false },
            { item = 'laser_drill',  amount = 1, price = 100000, label = 'Laser Drill',  requiredLevel = 10, mystery = true },
        },
    },
}

Config.SellNPCS = {  -- NPC that opens a shop to sell mining stuff
    {
        enabled = true, -- Set to false to disable the selling shop npc
        route = true,   -- If true, the sell NPC will have a route in the mining npc
        label = 'Ingots Selling',
        moneyType = 'bank',
        model = 'a_m_m_hillbilly_01',
        coords = vector3(1076.8552, -1987.3607, 29.9554),
        heading = 234.2191,
        blip = {
            enabled = true,
            sprite = 124,
            color = 31,
            display = 2,
            scale = 0.7,
            shortrange = true,
        },
        categories = { -- Price is per 1
            ['Ingots'] = {
                { item = 'copper_ingot',     price = 100,  label = 'Copper Ingot',     requiredLevel = 0, mystery = false },
                { item = 'iron_ingot',       price = 200,  label = 'Iron Ingot',       requiredLevel = 1, mystery = false },
                { item = 'silver_ingot',     price = 300,  label = 'Silver Ingot',     requiredLevel = 2, mystery = false },
                { item = 'gold_ingot',       price = 400,  label = 'Gold Ingot',       requiredLevel = 3, mystery = false },
                { item = 'platinum_ingot',   price = 500,  label = 'Platinum Ingot',   requiredLevel = 4, mystery = false },
                { item = 'titanium_ingot',   price = 750,  label = 'Titanium Ingot',   requiredLevel = 5, mystery = false },
                { item = 'mithril_ingot',    price = 1000, label = 'Mitril Ingot',     requiredLevel = 6, mystery = true },
                { item = 'adamantium_ingot', price = 1500, label = 'Adamantium Ingot', requiredLevel = 8, mystery = true },
            },
        },
    },
    {
        enabled = true, -- Set to false to disable the selling shop npc
        route = true,   -- If true, the sell NPC will have a route in the mining npc
        label = 'Ore Selling',
        moneyType = 'bank',
        model = 'a_m_m_hillbilly_01',
        coords = vector3(2664.0840, 2893.8633, 35.7282),
        heading = 350.2184,
        blip = {
            enabled = true,
            sprite = 124,
            color = 31,
            display = 2,
            scale = 0.7,
            shortrange = true,
        },
        categories = { -- Price is per 1
            ['Ores'] = {
                { item = 'coal_ore',       price = 10,  label = 'Coal Ore',       requiredLevel = 0, mystery = false },
                { item = 'copper_ore',     price = 10,  label = 'Copper Ore',     requiredLevel = 0, mystery = false },
                { item = 'iron_ore',       price = 20,  label = 'Iron Ore',       requiredLevel = 1, mystery = false },
                { item = 'silver_ore',     price = 30,  label = 'Silver Ore',     requiredLevel = 2, mystery = false },
                { item = 'gold_ore',       price = 40,  label = 'Gold Ore',       requiredLevel = 3, mystery = false },
                { item = 'platinum_ore',   price = 50,  label = 'Platinum Ore',   requiredLevel = 4, mystery = false },
                { item = 'titanium_ore',   price = 75,  label = 'Titanium Ore',   requiredLevel = 5, mystery = false },
                { item = 'mithril_ore',    price = 100, label = 'Mitril Ore',     requiredLevel = 6, mystery = true },
                { item = 'adamantium_ore', price = 150, label = 'Adamantium Ore', requiredLevel = 8, mystery = true },
            },
        },
    }
}

Config.VehicleRentals = { -- Vehicle rentals (clear table to disable)
    ['Dumpers Rental'] = {
        model = 'a_m_m_hillbilly_01',
        locations = {
            {
                coords = vector3(2706.0933, 2777.3484, 36.8780),
                heading = 63.5346,
                spawnCoords = vector4(2687.5459, 2767.3572, 36.8780, 203.7949),
                returnCoords = vector3(2697.3955, 2776.9321, 37.8780)
            },
        },
        moneyType = 'bank',
        vehicles = {
            { model = 'bulldozer', label = 'Bulldozer', rentInterval = 30, intervalPrice = 1500, deposit = 10000, requiredLevel = 1, mystery = false },
            { model = 'dump',      label = 'Dump',      rentInterval = 30, intervalPrice = 2500, deposit = 15000, requiredLevel = 3, mystery = false },
            { model = 'tiptruck2', label = 'Tiptruck',  rentInterval = 30, intervalPrice = 3000, deposit = 15000, requiredLevel = 3, mystery = false },
            { model = 'rubble',    label = 'Rubble',    rentInterval = 30, intervalPrice = 3500, deposit = 20000, requiredLevel = 5, mystery = true },
        },
        blip = {
            enabled = true,
            sprite = 124,
            color = 31,
            display = 2,
            scale = 0.7,
            shortrange = true,
        },
    },
}

--[[
    ONLY CHANGE THIS PART IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
---@type table Only change these if you have changed the name of a resource
Resources = {
    FM = { name = 'fmLib', export = 'new' },
    OXTarget = { name = 'ox_target', export = 'all' },
    QBTarget = { name = 'qb-target', export = 'all' },
}
IgnoreScriptFoundLogs = false
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.Ores = {
    ['Coal Ore'] = { -- Must be unique
        model = 'rx_coal_ore',
        spawnChance = 50,
        mineDuration = 5,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 60 },
            { item = 'coal_ore', min = 1, max = 2, chance = 40 },
        },
        xp = {
            mineGain = 5,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
            'Steel Pickaxe',
            'Iron Pickaxe',
            'Stone Pickaxe',
        },
    },
    ['Copper Ore'] = { -- Must be unique
        model = 'rx_copper_ore',
        spawnChance = 45,
        mineDuration = 7,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'copper_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 7,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
            'Steel Pickaxe',
            'Iron Pickaxe',
            'Stone Pickaxe',
        },
    },
    ['Iron Ore'] = { -- Must be unique
        model = 'rx_iron_ore',
        spawnChance = 40,
        mineDuration = 10,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'iron_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 10,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
            'Steel Pickaxe',
            'Iron Pickaxe',
        },
    },
    ['Silver Ore'] = { -- Must be unique
        model = 'rx_silver_ore',
        spawnChance = 35,
        mineDuration = 12,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'silver_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 12,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
            'Steel Pickaxe',
        },
    },
    ['Gold Ore'] = { -- Must be unique
        model = 'rx_gold_ore',
        spawnChance = 30,
        mineDuration = 15,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'gold_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 15,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
            'Steel Pickaxe',
        },
    },
    ['Platinum Ore'] = { -- Must be unique
        model = 'rx_green_ore',
        spawnChance = 25,
        mineDuration = 18,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'platinum_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 18,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
            'Titanium Pickaxe',
        },
    },
    ['Titanium Ore'] = { -- Must be unique
        model = 'rx_red_ore',
        spawnChance = 20,
        mineDuration = 20,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'titanium_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 20,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
            'Diamond Pickaxe',
        },
    },
    ['Mithril Ore'] = { -- Must be unique
        model = 'rx_mithril_ore',
        spawnChance = 15,
        mineDuration = 22,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 50 },
            { item = 'mithril_ore', min = 1, max = 2, chance = 50 },
        },
        xp = {
            mineGain = 22,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
            'Quantum Pickaxe',
        },
    },
    ['Adamantium Ore'] = { -- Must be unique
        model = 'rx_adamantium_ore',
        spawnChance = 10,
        mineDuration = 25,
        mineHits = { min = 2, max = 5 },
        lootLoop = 2,
        loot = {
            { item = 'stone', min = 1, max = 3, chance = 60 },
            { item = 'adamantium_ore', min = 1, max = 2, chance = 40 },
        },
        xp = {
            mineGain = 25,
        },
        tools = {
            'Laser Drill',
            'Mining Drill',
        },
    },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.Tools = {
    ['Stone Pickaxe'] = {   -- Must be unique
        item = 'stone_pickaxe', -- Item name
        requiredLevel = 0,  -- Required level to use the tool
        multipliers = {
            lootAmount = 1, -- 1x loot amount
            mineDuration = 1.0, -- 1x mining speed
            xpGain = 1.0,   -- 1x xp gain
        },
        durability = 100,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'prop_tool_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Iron Pickaxe'] = {        -- Must be unique
        item = 'iron_pickaxe',  -- Item name
        requiredLevel = 1,      -- Required level to use the tool
        multipliers = {
            lootAmount = 1.2,   -- 1.2x loot amount
            mineDuration = 1.2, -- 1.2x faster mining
            xpGain = 1.2,       -- 1.2x more xp on mining
        },
        durability = 120,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'rx_iron_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Steel Pickaxe'] = {       -- Must be unique
        item = 'steel_pickaxe', -- Item name
        requiredLevel = 3,      -- Required level to use the tool
        multipliers = {
            lootAmount = 1.5,   -- 1.5x loot amount
            mineDuration = 1.5, -- 1.5x faster mining
            xpGain = 1.5,       -- 1.5x more xp on mining
        },
        durability = 150,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'rx_steel_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Titanium Pickaxe'] = {       -- Must be unique
        item = 'titanium_pickaxe', -- Item name
        requiredLevel = 4,         -- Required level to use the tool
        multipliers = {
            lootAmount = 1.8,      -- 1.8x loot amount
            mineDuration = 1.8,    -- 1.8x faster mining
            xpGain = 1.8,          -- 1.8x more xp on mining
        },
        durability = 200,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'rx_titanium_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Diamond Pickaxe'] = {       -- Must be unique
        item = 'diamond_pickaxe', -- Item name
        requiredLevel = 5,        -- Required level to use the tool
        multipliers = {
            lootAmount = 2.0,     -- 2x loot amount
            mineDuration = 2.0,   -- 2x faster mining
            xpGain = 2.0,         -- 2x more xp on mining
        },
        durability = 250,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'rx_diamond_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Quantum Pickaxe'] = {       -- Must be unique
        item = 'quantum_pickaxe', -- Item name
        requiredLevel = 6,        -- Required level to use the tool
        multipliers = {
            lootAmount = 2.2,     -- 2.2x loot amount
            mineDuration = 2.2,   -- 2.2x faster mining
            xpGain = 2.2,         -- 2.2x more xp on mining
        },
        durability = 300,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'amb@world_human_hammering@male@base', anim = 'base' },
        prop = { bone = 57005, model = 'rx_quantum_pickaxe', position = vec3(0.09, -0.53, -0.22), rotation = vec3(252.0, 180.0, 0.0) },
    },
    ['Mining Drill'] = {        -- Must be unique
        item = 'mining_drill',  -- Item name
        requiredLevel = 8,      -- Required level to use the tool
        multipliers = {
            lootAmount = 2.5,   -- 2.5x loot amount
            mineDuration = 2.5, -- 2.5x faster mining
            xpGain = 2.5,       -- 2.5x more xp on mining
        },
        durability = 200,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'anim@heists@fleeca_bank@drilling', anim = 'drill_straight_fail' },
        prop = { bone = 57005, model = 'hei_prop_heist_drill', position = vec3(0.14, 0, -0.01), rotation = vec3(240.0, -90.0, 180.0) },
        type = 'drill',
    },
    ['Laser Drill'] = {         -- Must be unique
        item = 'laser_drill',   -- Item name
        requiredLevel = 10,     -- Required level to use the tool
        multipliers = {
            lootAmount = 3.0,   -- 3x loot amount
            mineDuration = 3.0, -- 3x faster mining
            xpGain = 3.0,       -- 3x more xp on mining
        },
        durability = 300,   -- Durability of the tool (1 hit = -1 durability)
        anim = { dict = 'anim@heists@fleeca_bank@drilling', anim = 'drill_straight_fail' },
        prop = { bone = 57005, model = 'ch_prop_laserdrill_01a', position = vec3(0.14, 0, -0.01), rotation = vec3(240.0, -90.0, 180.0) },
        type = 'laser',
    },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.MiningZones = {
    ['Quarry'] = {
        coords = vector3(2960.9, 2754.14, 43.71),
        distCheck = 250.0, -- From this distance, the ores will spawn
        route = {
            enabled = true,
            coords = { x = 2960.9, y = 2754.14 },
        },
        blip = {
            enabled = true,
            sprite = 124,
            color = 31,
            display = 2,
            scale = 0.7,
            shortrange = true,
        },
        radiusBlip = {
            enabled = true,
            radius = 250.0,
            color = 31,
            alpha = 80,
            shortrange = true,
        },
        piles = {
            prop = 'prop_pile_dirt_04', -- Pile prop
            moneyReward = { -- Rewards per pile delivery
                account = 'bank',
                min = 2500,
                max = 5000,
            },
            respawnTime = 120, -- Time in seconds for the piles to respawn after being picked up,
            pickupTrucks = {
                coords = {
                    spawn = vector4(2906.4185, 2743.2175, 62.5632, 54.4606), -- Spawns here, and drives to wait coords
                    wait = vector4(2863.9810, 2815.2759, 54.0413, 37.3363), -- Waits here until truck is loaded
                },
            },
            locations = {
                vector3(2966.245, 2746.693, 42.352),
                vector3(2952.649, 2735.566, 43.444),
                vector3(2997.287, 2783.369, 42.547),
                vector3(2959.59, 2812.581, 41.578),
                vector3(2944.008, 2840.525,46.364),
                vector3(2901.65, 2836.298, 53.15),
                vector3(2899.798, 2777.105, 53.43)
            }
        },
        ores = {
            types = { -- Ores that can be spawned in this zone, can be found in config/ores.lua
                'Coal Ore',
                'Copper Ore',
                'Iron Ore',
                'Silver Ore',
                'Gold Ore',
                'Platinum Ore',
                'Titanium Ore',
                'Mithril Ore',
                'Adamantium Ore',
            },
            respawnTime = 120, -- Time in seconds for the ores to respawn after being mined
            locations = {
                vector4(2972.131, 2733.69, 47.086, 0.0),
                vector4(2975.249, 2737.761, 45.029, 0.0),
                vector4(2977.998, 2744.554, 43.702, 0.0),
                vector4(2983.397, 2750.286, 43.059, 0.0),
                vector4(2988.004, 2751.694, 43.238, 0.0),
                vector4(2994.614, 2749.801, 43.845, 0.0),
                vector4(2999.735, 2752.794, 43.578, 0.0),
                vector4(3003.483, 2758.953, 43.552, 0.0),
                vector4(3006.159, 2766.938, 43.288, 0.0),
                vector4(3005.718, 2772.702, 43.566, 0.0),
                vector4(3005.868, 2782.333, 44.336, 0.0),
                vector4(3001.923, 2791.831, 44.868, 0.0),
                vector4(2997.226, 2799.491, 44.475, 0.0),
                vector4(2995.179, 2804.057, 43.774, 0.0),
                vector4(2990.477, 2809.765, 45.186, 0.0),
                vector4(2988.212, 2816.096, 45.161, 0.0),
                vector4(2985.038, 2820.812, 45.362, 0.0),
                vector4(2977.652, 2832.719, 46.17, 0.0),
                vector4(2974.027, 2837.605, 45.439, 0.0),
                vector4(2971.002, 2845.993, 46.927, 0.0),
                vector4(2965.965, 2849.03, 47.396, 0.0),
                vector4(2960.551, 2851.188, 47.459, 0.0),
                vector4(2949.143, 2853.326, 49.256, 0.0),
                vector4(2941.259, 2848.449, 50.257, 0.0),
                vector4(2976.559, 2797.309, 40.735, 0.0),
                vector4(2982.749, 2788.961, 40.61, 0.0),
                vector4(2984.002, 2781.289, 39.929, 0.0),
                vector4(2980.285, 2776.382, 38.59, 0.0),
                vector4(2973.776, 2770.377, 38.476, 0.0),
                vector4(2963.878, 2766.844, 39.159, 0.0),
                vector4(2956.515, 2766.928, 39.106, 0.0),
                vector4(2948.962, 2764.469, 39.111, 0.0),
                vector4(2941.931, 2764.766, 39.469, 0.0),
                vector4(2935.169, 2768.035, 39.308, 0.0),
                vector4(2930.377, 2774.647, 39.292, 0.0),
                vector4(2926.369, 2784.528, 39.653, 0.0),
                vector4(2920.771, 2788.506, 40.822, 0.0),
                vector4(2917.052, 2793.494, 40.978, 0.0),
                vector4(2916.166, 2800.705, 41.364, 0.0),
                vector4(2913.23, 2804.437, 43.465, 0.0),
                vector4(2909.323, 2784.156, 46.216, 0.0),
                vector4(2907.737, 2790.187, 45.689, 0.0),
                vector4(2913.81, 2776.38, 44.828, 0.0),
                vector4(2921.869, 2771.035, 44.961, 0.0),
                vector4(2928.904, 2758.136, 45.288, 0.0),
                vector4(2935.131, 2750.685, 44.202, 0.0),
                vector4(2935.628, 2739.898, 44.545, 0.0),
                vector4(2941.613, 2732.848, 46.611, 0.0),
                vector4(2946.104, 2725.058, 47.492, 0.0),
                vector4(2954.088, 2728.232, 46.192, 0.0),
                vector4(2920.36, 2810.497, 43.96, 0.0),
                vector4(2921.216, 2818.244, 48.168, 0.0),
                vector4(2926.992, 2822.444, 49.442, 0.0),
                vector4(2940.303, 2827.311, 45.466, 0.0),
                vector4(2947.281, 2825.892, 44.198, 0.0),
                vector4(2928.637, 2841.4, 49.966, 0.0),
                vector4(2920.226, 2837.515, 52.60, 0.0),
                vector4(2944.463, 2810.609, 40.916, 0.0),
                vector4(2930.665, 2808.528, 41.781, 0.0),
                vector4(2946.671, 2801.954, 40.234, 0.0),
                vector4(2945.47, 2783.788, 38.773, 0.0),
                vector4(2925.398, 2799.974, 40.414, 0.0),
                vector4(2940.528, 2795.039, 39.577, 0.0)
            },
        }
    },
    -- ONLY WORKS IF YOU HAVE K4MB1s mining cave
    -- ['K4MB1 Cave'] = {
    --     coords = vector3(2889.014, 2664.655, 41.72483000),
    --     distCheck = 250.0, -- From this distance, the ores will spawn
    --     route = {
    --         enabled = true,
    --         coords = { x = 2889.014, y = 2664.655 },
    --     },
    --     blip = {
    --         enabled = true,
    --         sprite = 89,
    --         color = 31,
    --         display = 2,
    --         scale = 0.7,
    --         shortrange = true,
    --     },
    --     radiusBlip = {
    --         enabled = true,
    --         radius = 250.0,
    --         color = 31,
    --         alpha = 80,
    --         shortrange = true,
    --     },
    --     ores = {
    --         types = { -- Ores that can be spawned in this zone, can be found in config/ores.lua
    --             'Coal Ore',
    --             'Copper Ore',
    --             'Iron Ore',
    --             'Silver Ore',
    --             'Gold Ore',
    --             'Platinum Ore',
    --             'Titanium Ore',
    --             'Mithril Ore',
    --             'Adamantium Ore',
    --         },
    --         respawnTime = 60, -- Time in seconds for the ores to respawn after being mined
    --         locations = {
    --             vector4(2903.924, 2734.51, 45.921, 0.0),
    --             vector4(2899.481, 2730.779, 45.425, 0.0),
    --             vector4(2895.09, 2724.717, 45.32, 0.0),
    --             vector4(2905.163, 2728.46, 45.09, 0.0),
    --             vector4(2906.665, 2724.114, 45.428, 0.0),
    --             vector4(2895.943, 2716.293, 44.565, 0.0),
    --             vector4(2897.467, 2712.547, 47.423, 0.0),
    --             vector4(2902.414, 2707.981, 49.084, 0.0),
    --             vector4(2908.923, 2704.294, 48.228, 0.0),
    --             vector4(2914.19, 2719.643, 47.782, 0.0),
    --             vector4(2925.843, 2704.066, 46.13, 0.0),
    --             vector4(2931.284, 2699.258, 45.588, 0.0),
    --             vector4(2930.438, 2692.098, 46.366, 0.0),
    --             vector4(2912.426, 2702.66, 45.55, 0.0),
    --             vector4(2910.119, 2696.946, 47.645, 0.0),
    --             vector4(2909.946, 2691.534, 48.793, 0.0),
    --             vector4(2914.93, 2688.337, 46.486, 0.0),
    --             vector4(2930.416, 2683.55, 45.585, 0.0),
    --             vector4(2908.266, 2674.681, 44.744, 0.0),
    --             vector4(2906.046, 2675.561, 46.67, 0.0),
    --             vector4(2903.386, 2677.438, 45.739, 0.0),
    --             vector4(2904.913, 2682.321, 47.889, 0.0),
    --             vector4(2900.68, 2684.448, 46.73, 0.0),
    --             vector4(2909.354, 2665.196, 45.173, 0.0),
    --             vector4(2893.833, 2666.695, 43.526, 0.0),
    --             vector4(2890.007, 2670.146, 47.558, 0.0),
    --             vector4(2887.072, 2682.467, 48.959, 0.0),
    --             vector4(2886.727, 2684.763, 46.615, 0.0),
    --             vector4(2893.788, 2693.427, 49.599, 0.0),
    --             vector4(2893.073, 2701.12, 50.355, 0.0),
    --             vector4(2883.536, 2706.984, 50.935, 0.0),
    --             vector4(2876.344, 2707.173, 48.571, 0.0),
    --             vector4(2870.545, 2702.85, 48.57, 0.0),
    --             vector4(2868.872, 2696.341, 46.301, 0.0),
    --             vector4(2882.04, 2683.838, 47.017, 0.0),
    --             vector4(2870.702, 2686.005, 45.638, 0.0),
    --             vector4(2853.012, 2687.119, 46.666, 0.0),
    --             vector4(2867.939, 2680.963, 47.678, 0.0),
    --             vector4(2864.84, 2675.749, 47.219, 0.0),
    --             vector4(2860.555, 2670.706, 46.141, 0.0),
    --             vector4(2843.561, 2678.655, 44.857, 0.0),
    --             vector4(2840.528, 2663.587, 44.083, 0.0),
    --             vector4(2858.927, 2665.299, 44.573, 0.0),
    --             vector4(2857.198, 2658.44, 44.449, 0.0),
    --             vector4(2853.214, 2656.552, 42.409, 0.0),
    --             vector4(2843.125, 2657, 42.564, 0.0),
    --             vector4(2856.627, 2651.828, 40.709, 0.0),
    --             vector4(2862.886, 2645.14, 39.292, 0.0),
    --             vector4(2863.778, 2632.931, 37.488, 0.0),
    --             vector4(2859.242, 2631.01, 36.903, 0.0),
    --             vector4(2855.322, 2627.785, 36.826, 0.0),
    --             vector4(2845.069, 2648.982, 38.773, 0.0),
    --             vector4(2842.53, 2643.105, 38.499, 0.0),
    --             vector4(2829.588, 2630.835, 36.428, 0.0),
    --             vector4(2831.625, 2620.545, 36.082, 0.0),
    --             vector4(2849.569, 2622.58, 36.241, 0.0),
    --             vector4(2842.126, 2617.233, 35.315, 0.0),
    --             vector4(2836.173, 2601.843, 34.626, 0.0),
    --             vector4(2830.256, 2616.84, 37.878, 0.0),
    --             vector4(2822.124, 2608.163, 37.01, 0.0),
    --             vector4(2819.792, 2603.137, 34.715, 0.0),
    --             vector4(2820.371, 2587.769, 32.404, 0.0),
    --             vector4(2831.502, 2594.34, 34.958, 0.0),
    --             vector4(2824.615, 2588.557, 30.13, 0.0),
    --             vector4(2826.229, 2590.13, 30.564, 0.0),
    --             vector4(2828.095, 2592.88, 30.934, 0.0),
    --             vector4(2826.593, 2646.326, 39.409, 0.0),
    --             vector4(2822.894, 2632.846, 39.49, 0.0),
    --             vector4(2816.04, 2632.326, 40.173, 0.0),
    --             vector4(2810.426, 2633.381, 40.408, 0.0),
    --             vector4(2800.591, 2629.87, 40.469, 0.0),
    --             vector4(2794.491, 2629.214, 39.544, 0.0),
    --             vector4(2793.237, 2633.625, 36.365, 0.0),
    --             vector4(2793.749, 2637.222, 36.914, 0.0),
    --             vector4(2792.893, 2640.345, 38.315, 0.0),
    --             vector4(2796.316, 2645.893, 40.358, 0.0),
    --             vector4(2810.946, 2651.419, 37.912, 0.0),
    --             vector4(2823.414, 2648.716, 39.608, 0.0),
    --             vector4(2877.583, 2632.081, 40.039, 0.0),
    --             vector4(2870.229, 2644.401, 41.185, 0.0),
    --             vector4(2874.439, 2648.021, 42.631, 0.0),
    --             vector4(2879.48, 2648.234, 42.111, 0.0),
    --             vector4(2886.622, 2650.144, 39.839, 0.0),
    --             vector4(2885.433, 2634.161, 43.295, 0.0),
    --             vector4(2890.993, 2636.254, 39.522, 0.0),
    --             vector4(2895.816, 2648.44, 39.64, 0.0),
    --             vector4(2895.346, 2628.416, 37.059, 0.0),
    --             vector4(2899.204, 2626.469, 36.835, 0.0),
    --             vector4(2896.814, 2626.734, 38.605, 0.0),
    --             vector4(2865.324, 2664.365, 47.697, 0.0),
    --             vector4(2861.872, 2666.336, 49.199, 0.0),
    --             vector4(2863.875, 2665.031, 50.488, 0.0)
    --         },
    --     }
    -- },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.MaxMissions = 6 -- Max amount of missions that can be active at the same time (make sure it's 1 less than the amount of missions in the table below so it can rotate)

Config.Missions = {
    -- Mine Missions
    ["Mine 50x Coal Ore"] = {
        endTime = 12, -- Time in hours to complete the mission (after this a random other mission will start)
        type = 'mined', -- 'mined'
        amount = 50, -- Amount of hits required
        ore = 'Coal Ore', -- Ore to mine
        rewards = {
            xp = 50, -- Set to 0 to disable
            money = 1000, -- Set to 0 to disable
            moneyType = 'bank',
            items = {}, -- Empty table to disable
        }
    },
    ["Mine 40x Copper Ore"] = {
        endTime = 10,
        type = 'mined',
        amount = 40,
        ore = 'Copper Ore',
        rewards = {
            xp = 70,
            money = 1200,
            moneyType = 'cash',
            items = {},
        }
    },
    ["Mine 35x Iron Ore"] = {
        endTime = 14,
        type = 'mined',
        amount = 35,
        ore = 'Iron Ore',
        rewards = {
            xp = 100,
            money = 1500,
            moneyType = 'bank',
            items = {
                -- { item = 'iron_bar', amount = 5 }
            }, -- Example reward item
        }
    },
    ["Mine 30x Silver Ore"] = {
        endTime = 8,
        type = 'mined',
        amount = 30,
        ore = 'Silver Ore',
        rewards = {
            xp = 120,
            money = 2000,
            moneyType = 'bank',
            items = {},
        }
    },
    ["Mine 20x Gold Ore"] = {
        endTime = 12,
        type = 'mined',
        amount = 20,
        ore = 'Gold Ore',
        rewards = {
            xp = 150,
            money = 3000,
            moneyType = 'bank',
            items = {
                -- { item = 'gold_bar', amount = 3 }
            },
        }
    },
    ["Mine 15x Platinum Ore"] = {
        endTime = 16,
        type = 'mined',
        amount = 15,
        ore = 'Platinum Ore',
        rewards = {
            xp = 200,
            money = 5000,
            moneyType = 'cash',
            items = {
                -- { item = 'platinum_ingot', amount = 2 }
            },
        }
    },
    ["Mine 10x Titanium Ore"] = {
        endTime = 18,
        type = 'mined',
        amount = 10,
        ore = 'Titanium Ore',
        rewards = {
            xp = 250,
            money = 7500,
            moneyType = 'bank',
            items = {},
        }
    },
    ["Mine 8x Mithril Ore"] = {
        endTime = 20,
        type = 'mined',
        amount = 8,
        ore = 'Mithril Ore',
        rewards = {
            xp = 300,
            money = 10000,
            moneyType = 'bank',
            items = {
                -- { item = 'mithril_bar', amount = 1 }
            },
        }
    },
    ["Mine 5x Adamantium Ore"] = {
        endTime = 24,
        type = 'mined',
        amount = 5,
        ore = 'Adamantium Ore',
        rewards = {
            xp = 500,
            money = 15000,
            moneyType = 'bank',
            items = {
                -- { item = 'adamantium_shard', amount = 1 }
            },
        }
    },
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.Levels = { -- Levels must be incremental by 1, starting from 1
    -- level 0 is the default starter level everyone has
    [1] = 100, -- 100 xp needed to reach level 1
    [2] = 250,
    [3] = 500,
    [4] = 750,
    [5] = 1000,
    [6] = 1500,
    [7] = 2000,
    [8] = 2750,
    [9] = 3500,
    [10] = 5000,
}

Opensource files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

function ShowTextUI(text, opts)
    if not TextUIShown then
        TextUIShown = true
        lib.showTextUI(text, opts)
    end
end

function HideTextUI()
    if TextUIShown then
        TextUIShown = false
        lib.hideTextUI()
    end
end

function AddMiningNPCTarget(ped)
    if OXTarget then
        OXTarget:addLocalEntity(ped, {
            {
                label = 'Open Bob The Miner',
                name = 'openMiningNPC',
                icon = 'fas fa-trowel',
                distance = 2.5,
                onSelect = function(data)
                    OpenMiningUI()
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(ped, {
            options = {
                {
                    label = 'Open Bob The Miner',
                    icon = 'fas fa-trowel',
                    targeticon = 'fas fa-trowel',
                    action = function(entity)
                        OpenMiningUI()
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddOreTarget(zoneName, oreId)
    local ore = SpawnedOres[zoneName][oreId]

    if OXTarget then
        OXTarget:addLocalEntity(ore.obj, {
            {
                label = 'Mine '..ore.name,
                name = 'mineOre',
                icon = 'fas fa-trowel',
                distance = 2.5,
                canInteract = function()
                    return not IsMining
                end,
                onSelect = function(data)
                    MineOre(zoneName, oreId)
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(ore.obj, {
            options = {
                {
                    label = 'Mine '..ore.name,
                    icon = 'fas fa-trowel',
                    targeticon = 'fas fa-trowel',
                    canInteract = function()
                        return not IsMining
                    end,
                    action = function(entity)
                        MineOre(zoneName, oreId)
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddShopNPCTarget(npc)
    if OXTarget then
        OXTarget:addLocalEntity(npc, {
            {
                label = 'Open Mining Shop',
                name = 'openMiningShop',
                icon = 'fas fa-shopping-cart',
                distance = 2.5,
                onSelect = function(data)
                    OpenShopNPC()
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(npc, {
            options = {
                {
                    label = 'Open Mining Shop',
                    icon = 'fas fa-shopping-cart',
                    targeticon = 'fas fa-shopping-cart',
                    action = function(entity)
                        OpenShopNPC()
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddSellNPCTarget(npc, sellId)
    if OXTarget then
        OXTarget:addLocalEntity(npc, {
            {
                label = 'Open Mining Selling',
                name = 'openMiningSelling',
                icon = 'fas fa-shopping-cart',
                distance = 2.5,
                onSelect = function(data)
                    OpenSellNPC(sellId)
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(npc, {
            options = {
                {
                    label = 'Open Mining Selling',
                    icon = 'fas fa-shopping-cart',
                    targeticon = 'fas fa-shopping-cart',
                    action = function(entity)
                        OpenSellNPC(sellId)
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function AddVehicleRentalNPCTarget(npc, rentalName, locIndex)
    if OXTarget then
        OXTarget:addLocalEntity(npc, {
            {
                label = 'Open '..rentalName,
                name = 'openVehicleRental',
                icon = 'fas fa-truck',
                distance = 2.5,
                onSelect = function(data)
                    OpenVehicleRental(rentalName, locIndex)
                end,
            }
        })
    elseif QBTarget then
        QBTarget:AddTargetEntity(npc, {
            options = {
                {
                    label = 'Open '..rentalName,
                    icon = 'fas fa-ship',
                    targeticon = 'fas fa-truck',
                    action = function(entity)
                        OpenVehicleRental(rentalName, locIndex)
                    end,
                }
            },
            distance = 2.5,
        })
    end
end

function RemoveShopNPCTarget(ped)
    if OXTarget then
        OXTarget:removeLocalEntity(ped, 'openMiningShop')
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ped, 'Open Mining Shop')
    end
end

function RemoveSellNPCTarget(ped)
    if OXTarget then
        OXTarget:removeLocalEntity(ped, 'openMiningSelling')
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ped, 'Open Mining Selling')
    end
end

function RemoveTarget(ent, name)
    if OXTarget then
        OXTarget:removeLocalEntity(ent, name)
    elseif QBTarget then
        QBTarget:RemoveTargetEntity(ent, name)
    end
end

function GetItemsAmounts()
    return FM.callback.sync('mining:getItemsAmounts')
end

function MineProgressBar(toolFound, duration)
    local cfgTool = Config.Tools[toolFound]

    return FM.progress.start({
        label = 'Mining',
        time = duration,
        anim = cfgTool.anim,
        disable = {
            move = true,
            car = true,
            combat = true,
        },
        prop = cfgTool.prop,
        type = 'circle',
    })
end

---@param type 'returnVehicle'
function ShowMarker(type, coords)
    if type == 'returnVehicle' then
        DrawMarker(39, coords, 0, 0, 0, 0, 0, 0, 3.0, 3.0, 3.0, 255, 100, 100, 100, false, true, 2, false, false, false, false)
    end
end

function ShowHelpNotification(msg, thisFrame, beep, duration)
    AddTextEntry('helpNotification', msg)

    if thisFrame then
        DisplayHelpTextThisFrame('helpNotification', false)
    else
        if beep == nil then
            beep = true
        end
        BeginTextCommandDisplayHelp('helpNotification')
        EndTextCommandDisplayHelp(0, false, beep, duration or -1)
    end
end

local function notifyPolice(coords, msg)
    local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
    SetBlipSprite(blip, 161)
    SetBlipScale(blip, 1.0)
    SetBlipColour(blip, 1)
    SetBlipAsShortRange(blip, false)
    BeginTextCommandSetBlipName("STRING")
    AddTextComponentString(_L('blip_suspicious_mining_activity'))
    EndTextCommandSetBlipName(blip)

    FM.utils.notify(msg, 'error')

    Wait(20000)
    RemoveBlip(blip)
end

RegisterNetEvent('mining:notifyPolice', function(coords, msg)
    notifyPolice(coords, msg)
end)
--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.DiscordWebhook = ''

local function getPoliceSources()
    local players = FM.utils.getPlayers()
    local policeSources = {}

    for src, p in pairs(players) do
        if p.getJob().name == 'police' then
            policeSources[#policeSources+1] = src
        end
    end

    return policeSources
end

function NotifyPolice(coords, msg)
    local police = getPoliceSources()

    for _, src in pairs(police) do
        TriggerClientEvent('mining:notifyPolice', src, coords, msg)
    end
end

function HasMiningLicense(src)
    local p = FM.player.get(src)
    if not p then return false end

    local identifier = p.getIdentifier()
    if not Miners[identifier] then return false end

    return Miners[identifier].license
end

--[[
    esx_licenses INTEGRATION FOR CHECKING MINING LICENSE
    UNCOMMENT FUNCTION BELOW
    RENAME 'mining_license_name_here' TO YOUR MINING LICENSE NAME
    REMOVE/COMMENT THE FUNCTION ABOVE: function HasMiningLicense(src) ...... end
]]
-- function HasMiningLicense(src)
--     local hasLicense = promise.new()

--     TriggerEvent('esx_license:checkLicense', src, 'mining_license_name_here', function(bool)
--         hasLicense:resolve(bool)
--     end)

--     return Citizen.Await(hasLicense)
-- end

FM.callback.register('mining:getItemsAmounts', function(src)
    local p = FM.player.get(src)
    if not p then return end

    local items = p.getItems()
    local amounts = {}

    for _, item in pairs(items) do
        if amounts[item.name] then
            amounts[item.name] = amounts[item.name] + item.amount
        else
            amounts[item.name] = item.amount
        end
    end

    return amounts
end)

RegisterNetEvent('mining:onLicenseBought', function(playerId)
    -- This event will be called whenever a player bought a mining license
end)

RegisterNetEvent('mining:onOreMined', function(playerId, oreName, miner)
    -- This event will be called whenever a player hit an ore
end)
PreviousInstallationNextExports

Last updated 3 months ago

🌐
📝