> For the complete documentation index, see [llms.txt](https://shift-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shift-studios.gitbook.io/docs/new/editor-33.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# Advanced Mining

Transform Your Server With Shift Studios — Powerful, Optimized, And Reliable Resources Built To Improve Every Experience.

<figure><img src="https://4062160621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgqh3gjuJzDAWNXTD9sEE%2Fuploads%2F1pk7INdma9bvbIRBhoP5%2F4bb9e92c-1a09-4d11-a15a-bb5db3cbc058.png?alt=media&amp;token=b531fcc0-d842-4b96-92d4-991cd162f6b2" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### Advanced Mining

Read Everything Below To Install
{% endstep %}

{% step %}

### Drag & Drop

Drag & Drop The Resource Into Your FiveM Server
{% endstep %}

{% step %}

### Ensure The Resource

Make Sure To Ensure shift-mining In Your Server CFG.
{% endstep %}

{% step %}

### Install The SQL Table

{% code expandable="true" %}

```sql
CREATE TABLE IF NOT EXISTS shift_mining (
  identifier VARCHAR(64) NOT NULL,
  name VARCHAR(64) NULL,
  total_rocks INT NOT NULL DEFAULT 0,
  level INT NOT NULL DEFAULT 1,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (identifier)
);
```

{% endcode %}
{% endstep %}

{% step %}

### Install The Items & Images

```
Images Are Located Inside The Install Folder
```

{% code expandable="true" %}

```lua
['shiftpickaxe'] = {
    label = 'Pickaxe',
    weight = 900,
    stack = false,
    close = true,
    description = 'Pickaxe For Shift Mining',
    client = { image = 'shiftpickaxe.png' }
},

['shiftsolidcopper'] = {
    label = 'Copper Bar',
    weight = 500,
    stack = true,
    close = true,
    description = 'Copper Bar For Shift Mining',
    client = { image = 'shiftsolidcopper.png' }
},

['shiftsolidiron'] = {
    label = 'Iron Bar',
    weight = 500,
    stack = true,
    close = true,
    description = 'Iron Bar For Shift Mining',
    client = { image = 'shiftsolidiron.png' }
},

['shiftsolidsilver'] = {
    label = 'Silver Bar',
    weight = 500,
    stack = true,
    close = true,
    description = 'Silver Bar For Shift Mining',
    client = { image = 'shiftsolidsilver.png' }
},

['shiftsolidgold'] = {
    label = 'Gold Bar',
    weight = 500,
    stack = true,
    close = true,
    description = 'Gold Bar For Shift Mining',
    client = { image = 'shiftsolidgold.png' }
},

['shiftcopper'] = {
    label = 'Copper Ore',
    weight = 125,
    stack = true,
    close = true,
    description = 'Copper Ore For Shift Mining',
    client = { image = 'shiftcopper.png' }
},

['shiftiron'] = {
    label = 'Iron Ore',
    weight = 125,
    stack = true,
    close = true,
    description = 'Iron Ore For Shift Mining',
    client = { image = 'shiftiron.png' }
},

['shiftsilver'] = {
    label = 'Silver Ore',
    weight = 125,
    stack = true,
    close = true,
    description = 'Silver Ore For Shift Mining',
    client = { image = 'shiftsilver.png' }
},

['shiftgold'] = {
    label = 'Gold Ore',
    weight = 125,
    stack = true,
    close = true,
    description = 'Gold Ore For Shift Mining',
    client = { image = 'shiftgold.png' }
},

['shiftcoal'] = {
    label = 'Coal',
    weight = 125,
    stack = true,
    close = true,
    description = 'Coal For Shift Mining',
    client = { image = 'shiftcoal.png' }
},

['shiftsulfur'] = {
    label = 'Sulfur',
    weight = 125,
    stack = true,
    close = true,
    description = 'Sulfur For Shift Mining',
    client = { image = 'shiftsulfur.png' }
},

['shiftsalt'] = {
    label = 'Salt',
    weight = 125,
    stack = true,
    close = true,
    description = 'Salt For Shift Mining',
    client = { image = 'shiftsalt.png' }
},

['shiftruby'] = {
    label = 'Ruby',
    weight = 125,
    stack = true,
    close = true,
    description = 'Ruby For Shift Mining',
    client = { image = 'shiftruby.png' }
},

['shiftsapphire'] = {
    label = 'Sapphire',
    weight = 125,
    stack = true,
    close = true,
    description = 'Sapphire For Shift Mining',
    client = { image = 'shiftsapphire.png' }
},

['shiftemerald'] = {
    label = 'Emerald',
    weight = 125,
    stack = true,
    close = true,
    description = 'Emerald For Shift Mining',
    client = { image = 'shiftemerald.png' }
},

['shiftdiamond'] = {
    label = 'Diamond',
    weight = 125,
    stack = true,
    close = true,
    description = 'Diamond For Shift Mining',
    client = { image = 'shiftdiamond.png' }
},
```

{% endcode %}
{% endstep %}

{% step %}

### Configure Resource

Make Sure To Configure The Resource To Your Liking

You Can Configure Your Discord Logs In server/config.discord.lua

{% code expandable="true" %}

```lua
-- ⚫ ███████╗██╗  ██╗██╗███████╗████████╗    ███████╗████████╗██╗   ██╗██████╗ ██╗ ██████╗ ███████╗ ⚫
-- ⬛ ██╔════╝██║  ██║██║██╔════╝╚══██╔══╝    ██╔════╝╚══██╔══╝██║   ██║██╔══██╗██║██╔═══██╗██╔════╝ ⬛
-- ⚫ ███████╗███████║██║█████╗     ██║       ███████╗   ██║   ██║   ██║██║  ██║██║██║   ██║███████╗ ⚫
-- ⬛ ╚════██║██╔══██║██║██╔══╝     ██║       ╚════██║   ██║   ██║   ██║██║  ██║██║██║   ██║╚════██║ ⬛
-- ⚫ ███████║██║  ██║██║██║        ██║       ███████║   ██║   ╚██████╔╝██████╔╝██║╚██████╔╝███████║ ⚫
-- ⬛ ╚══════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝       ╚══════╝   ╚═╝    ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ ⬛

Config = Config or {}

Config.Job = {
  Enabled = false,
  Name = 'miner',
  MinGrade = 0,
}

-- All integrations can be auto-detected or explicitly selected.
-- Framework: auto | es_extended | qb-core | qbx_core | standalone
-- Inventory: auto | ox_inventory | qb-inventory | qs-inventory | esx
-- Target: auto | ox_target | qb-target | qtarget | textui (E-key fallback)
-- Notification: auto | ox_lib | qbx_core | qb-core | es_extended | okokNotify | mythic_notify | native
-- TextUI: auto | ox_lib | qb-core | okokTextUI | es_extended | native
Config.Integrations = {
  Framework = 'auto',
  Inventory = 'auto',
  Target = 'auto',
  Notification = 'ox_lib',
  TextUI = 'auto',
  MoneyAccount = 'cash', -- cash or bank; ESX/QB/Qbox. Standalone uses StandaloneCashItem.
  StandaloneCashItem = 'money', -- standalone only: registered inventory item serving as cash
}


Config.Commands = {
  Enabled = true,
  Leaderboard = 'mineleaderboard',
  Stats = 'miningstats',
  RestrictToMineZone = false,
  RestrictDistance = 200.0,
}

Config.Protection = {
  MineCooldownMs = 5000,
  MaxSpotDistance = 3.0,
  RequirePickaxe = true,
  Debug = false,
}

Config.Pickaxe = {
  Item = 'shiftpickaxe',
  Price = 5000,
  WeaponHash = `WEAPON_BATTLEAXE`, -- replace with your addon pickaxe hash
}

-- Mining Spots (No Props)
-- Add/remove spots here. You can have multiple mines.
Config.Mines = {
  {
    name = 'Mining Spot',
    -- optional: used for restrictions and blip
    center = vec3(2950.74, 2796.58, 40.50),
    blip = { Enabled=true, Sprite=618, Color=46, Scale=0.6, Label='Mining : Mine Spot' },

    -- mining spots to target
    spots = {
      vec3(2951.9666, 2769.3870, 39.0536),
      vec3(2938.1501, 2772.3682, 39.2516),
      vec3(2955.1165, 2773.4497, 39.4716),
      vec3(2946.5398, 2767.0889, 39.1810),
      vec3(2980.0669, 2782.1648, 39.0900),
      vec3(2972.4131, 2797.4697, 41.1897),
      vec3(2929.4121, 2789.4358, 40.0325),
      vec3(2922.4377, 2798.8438, 41.2058),
      vec3(2971.2546, 2798.8223, 41.3273),
      vec3(2969.0071, 2776.5698, 38.3787),
    }
  }
}

Config.Mining = {
  DurationMs = 10000,
}

-- Pretty labels for items that aren't in Config.Ores (ex: ingots)
Config.ItemLabels = {
  shiftpickaxe = 'Pickaxe',
  shiftsolidcopper = 'Copper Bar',
  shiftsolidiron = 'Iron Bar',
  shiftsolidsilver = 'Silver Bar',
  shiftsolidgold = 'Gold Bar',
  shiftcopper = 'Copper Ore',
  shiftiron = 'Iron Ore',
  shiftsilver = 'Silver Ore',
  shiftgold = 'Gold Ore',
  shiftcoal = 'Coal',
  shiftsulfur = 'Sulfur',
  shiftsalt = 'Salt',
  shiftruby = 'Ruby',
  shiftsapphire = 'Sapphire',
  shiftemerald = 'Emerald',
  shiftdiamond = 'Diamond',
}

Config.Ores = {
  { item='shiftcoal',     label='Coal',        image='shiftcoal.png',     min=1, max=3, weight=1.00 },
  { item='shiftcopper',   label='Copper Ore',  image='shiftcopper.png',   min=1, max=2, weight=0.90 },
  { item='shiftiron',     label='Iron Ore',    image='shiftiron.png',     min=1, max=2, weight=0.80 },
  { item='shiftsulfur',   label='Sulfur',      image='shiftsulfur.png',   min=1, max=2, weight=0.65 },
  { item='shiftsalt',     label='Salt',        image='shiftsalt.png',     min=1, max=3, weight=0.60 },
  { item='shiftgold',     label='Gold Ore',    image='shiftgold.png',     min=1, max=1, weight=0.25 },
  { item='shiftsilver',   label='Silver Ore',  image='shiftsilver.png',   min=1, max=1, weight=0.35 },
  { item='shiftruby',     label='Ruby',        image='shiftruby.png',     min=1, max=1, weight=0.10 },
  { item='shiftsapphire', label='Sapphire',    image='shiftsapphire.png', min=1, max=1, weight=0.10 },
  { item='shiftemerald',  label='Emerald',     image='shiftemerald.png',  min=1, max=1, weight=0.08 },
  { item='shiftdiamond',  label='Diamond',     image='shiftdiamond.png',  min=1, max=1, weight=0.05 },
}

Config.Shop = {
  Location = vec3(2944.9600, 2746.6296, 43.3839),
  Heading = 287.7233,
  Ped = { Enabled = true, Model = `s_m_y_construct_02`, Scenario = 'WORLD_HUMAN_STAND_IMPATIENT' },
}

Config.Smelter = {
  Enabled = true,
  Location = vec3(2663.5774, 2891.2363, 36.9375),
  Heading = 20.7524,
  Ped = { Enabled = true, Model = `s_m_y_construct_01`, Scenario = 'WORLD_HUMAN_CLIPBOARD' },
  Blip = { Enabled = true, Sprite = 618, Color = 47, Scale = 0.65, Label = 'Shift Mining : Smelter' },
  DurationMs = 10000,
  Recipes = {
    { input='shiftcopper', inputCount=5, output='shiftsolidcopper', outputCount=1 },
    { input='shiftiron',   inputCount=5, output='shiftsolidiron',   outputCount=1 },
    { input='shiftsilver', inputCount=5, output='shiftsolidsilver', outputCount=1 },
    { input='shiftgold',   inputCount=5, output='shiftsolidgold',   outputCount=1 },
  }
}

Config.Seller = {
  Enabled = true,
  Order = {
    'shiftcoal', 'shiftcopper', 'shiftiron', 'shiftsulfur', 'shiftsalt',
    'shiftgold', 'shiftsilver', 'shiftruby', 'shiftsapphire', 'shiftemerald', 'shiftdiamond',
    'shiftsolidcopper', 'shiftsolidiron', 'shiftsolidsilver', 'shiftsolidgold',
  },
  Location = vec3(2632.5710, 2935.4087, 40.4216),
  Heading = 62.2589,
  Ped = { Enabled = true, Model = `s_m_m_highsec_01`, Scenario = 'WORLD_HUMAN_GUARD_STAND' },
  Blip = { Enabled = true, Sprite = 500, Color = 2, Scale = 0.65, Label = 'Shift Mining : Material Buyer' },
  Prices = {
    shiftcoal     = 55,
    shiftcopper   = 115,
    shiftiron     = 140,
    shiftsulfur   = 95,
    shiftsalt     = 35,
    shiftgold     = 480,
    shiftsilver   = 270,
    shiftruby     = 820,
    shiftsapphire = 820,
    shiftemerald  = 920,
    shiftdiamond  = 1500,
    shiftsolidcopper = 260,
    shiftsolidiron   = 320,
    shiftsolidsilver = 650,
    shiftsolidgold   = 1100,
  }
}

Config.Ranking = {
  Enabled = true,
  XPPerRock = 10,
  Levels = {
    { level=1, rocks=0,   multiplier=1.00 },
    { level=2, rocks=50,  multiplier=1.05 },
    { level=3, rocks=125, multiplier=1.10 },
    { level=4, rocks=250, multiplier=1.15 },
    { level=5, rocks=450, multiplier=1.20 },
    { level=6, rocks=750, multiplier=1.25 },
    { level=7, rocks=1150,multiplier=1.30 },
  }
}

Config.Leaderboard = {
  Enabled = true,
  TopN = 5,
}


Config.UI = {
  StatsTarget = true,
  ReopenSmelterAfterProcess = true,
  ProgressCancelKey = 73, -- X
  MenuDefaultSide = 'right',
  ReopenSellerAfterSale = true,
  HandOffDurationMs = 1750, -- Ped and player give/take animation
}


Config.Strings = (Locale and Locale.Strings) or {
  target_mine = 'Mine Rock',
  target_open_shop = 'Open Pickaxe Shop',
  target_smelter = 'Open Smelter',
  target_seller = 'Sell Materials',
  target_leaderboard = 'Mining Leaderboard',
  shop_title = 'Equipment Supplier',
  shop_buy_pickaxe = 'Buy Pickaxe',
  shop_price = 'Price: $%s',
  smelt_title = 'Ore Smelter',
  smelt_action = 'Smelting...',
  sell_title = 'Material Buyer',
  sell_action = 'Sell Materials',
  leaderboard_title = 'Mining Leaderboard'
}

-- Notifications use the normal Ox Lib theme by default.
-- Add a style table to Defaults or an individual message only when custom styling is wanted.
-- Available placeholders include: {amount}, {ore}, {level}, {multiplier}, and {total}.
Config.Notifications = {
  Enabled = true,

  Defaults = {
    title = 'Advanced Mining',
    position = 'center-left',
    duration = 5000,
    showDuration = true,
    alignIcon = 'center'
  },

  Messages = {
    shop_no_money = {
      description = 'Not Enough Money',
      type = 'error',
      icon = 'money-bill-wave'
    },

    shop_bought = {
      description = 'Purchased A Pickaxe',
      type = 'success',
      icon = 'hammer'
    },

    mining_invalid = {
      description = 'Invalid Mining Equipment',
      type = 'error',
      icon = 'triangle-exclamation'
    },

    mining_wait = {
      description = 'Slow Down',
      type = 'warning',
      icon = 'clock'
    },

    need_job = {
      description = 'You Are Not Certified To Do This',
      type = 'error',
      icon = 'id-card'
    },

    need_pickaxe = {
      description = 'You Need A Pickaxe',
      type = 'error',
      icon = 'hammer'
    },

    mining_cancelled = {
      description = 'Mining Cancelled',
      type = 'error',
      icon = 'xmark'
    },

    mining_success = {
      description = 'You Mined The Rock',
      type = 'success',
      icon = 'gem'
    },

    rank_up = {
      description = 'Rank Up! You Are Now Level {level} (x{multiplier} Rewards)',
      type = 'success',
      icon = 'arrow-up'
    },

    smelt_cancelled = {
      description = 'Smelting Cancelled',
      type = 'error',
      icon = 'xmark'
    },

    inventory_full = {
      description = 'You Do Not Have Enough Inventory Space',
      type = 'error',
      icon = 'box-open'
    },

    smelt_missing = {
      description = "You Don't Have The Required Items",
      type = 'error',
      icon = 'box-open'
    },

    smelt_done = {
      description = 'Smelting Complete',
      type = 'success',
      icon = 'fire'
    },

    sell_nothing = {
      description = 'You Have Nothing To Sell',
      type = 'error',
      icon = 'box-open'
    },

    sell_cancelled = { description = 'Sale Cancelled', type = 'warning', icon = 'xmark' },

    sell_done = {
      description = 'Sold Materials For {total}',
      type = 'success',
      icon = 'dollar-sign'
    },

    lb_disabled = {
      description = 'Leaderboard Is Disabled',
      type = 'error',
      icon = 'trophy'
    },

    must_be_near_mine = {
      description = 'You Must Be Near The Mine',
      type = 'error',
      icon = 'location-dot'
    },
  }
}

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

Ensure Everything Is Working Well & Enjoy !!
{% endstep %}
{% endstepper %}
