# MX-mining - Mining (Dynamite + Pickaxe)
Preview: https://youtu.be/izQn0WXqkeA
Discord: https://discord.gg/fNNf4Rqv9V
Mining system with dynamite and pickaxe for RedM. **Supports VORP and RSG.** Each mine has different rewards.
## Installation
1. Place the `MX-mining` folder in `resources/[framework]/`
2. Add `ensure MX-mining` to `server.cfg` (after ox_lib and inventory)
-
**VORP**: Run `sql/items.sql` in your database
-
**RSG**: Ensure dynamite and pickaxe have `useable = true` in rsg-inventory
## Dependencies
-
**ox_lib** (required)
-
**VORP**: vorp_core, vorp_inventory
-
**RSG**: rsg-core, rsg-inventory
## Configuration
In `config.lua`:
| Option | Description |
|--------|-------------|
| `Config.Framework` | `'auto'`, `'vorp'` or `'rsg'` |
| `Config.DynamiteItem` | Dynamite item name |
| `Config.PickaxeItems` | Array of pickaxes: `{ item, durabilityLoss }` — supports multiple pickaxe types |
| `Config.MineZones` | Each mine has `coords`, `radius`, `rewards`, and `points` (pickaxe mining spots) |
| `Config.PickaxeDurabilityThreshold` | Below this durability, pickaxe may break (VORP metadata) |
| `Config.PickaxeInitialDurability` | Starting durability when no metadata (default: 99) |
| `Config.PickaxeCooldownSeconds` | Cooldown per mining point |
| `Config.CooldownSeconds` | Cooldown after dynamite explosion |
### Pickaxe Metadata (VORP)
VORP uses metadata for pickaxe durability (like vorp_mining/vorp_lumberjack):
- Durability starts at 99 and decreases per use
- Below threshold: random chance to break
- RSG uses `info.quality` for durability
## How to Use
### Dynamite
1. Use the dynamite item from inventory
-
**Place**: Hold SPACE to place on the ground
-
**Light**: Get close and hold SPACE to light the fuse
-
**Collect**: After explosion, hold SPACE to collect minerals
-
**Cancel**: BACKSPACE
### Pickaxe
1. Use the pickaxe item from inventory (equips in hand)
2. Go to a mine and approach a mining point
3. "Mine" prompt appears when near with pickaxe equipped
4. Hold SPACE for the configured time to mine
5. Receive minerals (each mine drops different items)
6. BACKSPACE to store the pickaxe