L3THDocs

Scripts

Advanced Mining Job

Hands-on mining with a real production chain. Break the rock, clean and smelt the ore, sell the bars.

Requires
ox_lib
Frameworks
Standalone, works with any framework
Target & inventory
ox or qb target; ox, qb or ps inventory; or your own
Latest version 2.1.9 View in store

#Install

  1. #Install dependencies

    Install (or update) ox_lib, and start it before this script in your server.cfg.

    github.com/CommunityOx/ox_lib/releases

  2. #Check your inventory, target, notify and progress bar

    Besides ox_lib, the script needs an inventory, a target, notifications and a progress bar. Pick yours under system in configs/cl_config.lua: 'ox' or 'qb' work out of the box.

    Using something else? Make your own in utils/cl_utils.lua and utils/sv_utils.lua. These are the calls the script makes, shown with the ox resources:

    lua
    -- Client side
    return exports.ox_inventory:Search('count', item) >= count
    
    -- Server side
    return exports.ox_inventory:AddItem(source, item, count, metadata or nil)
    return exports.ox_inventory:RemoveItem(source, item, count)
    return exports.ox_inventory:Search(source, 'count', item) >= count
    return exports.ox_inventory:CanCarryItem(source, item, count)
    return exports.ox_inventory:GetItemCount(inv, itemName, metadata, strict)
  3. #Add the items

    The INSTALL folder has every item and image ready.

    • Copy the items from INSTALL/ox-inventory.lua into ox_inventory/data/items.lua
    • Copy the images from INSTALL/images into ox_inventory/web/images

    Each item looks like this:

    lua
    ["l3th_rock"] = {
      label = "Rock",
      weight = 2500,
      stack = true,
      close = true,
      client = {
        image = "l3th_rock.png",
      }
    },
  4. #Get a pickaxe

    Players mine with a pickaxe weapon. Any pickaxe asset works; we recommend this free one:

    github.com/void-hub-scripts/vh-pickaxe

  5. #Start the script

    • Put the l3th-minerjob folder in your resources folder
    • Add ensure l3th-minerjob to your server.cfg, after its dependencies
    • Restart the server

#Configuration

Settings are in configs/: cl_config.lua (blips, locations, the pickaxe shop), sv_config.lua (rocks and rewards) and sh_config.lua.

#Need help?

Most issues come from a missing dependency or the wrong start order in server.cfg, so run through the steps once more first. Still stuck? See Common problems or open a ticket on Discord.