lation scripts
scriptsmembershipdocs
see the scripts
Skip to Content
lation ui
lation interact
lation banking
lation shops
lation jobs
lation weed
lation chop shop

classics

money laundering
drug sales
coke processing
meth crafting
metal detecting
DetectingConfigurationDevelopersChangelog
scuba diving

metal detecting

Requirements, install steps, items and first start for metal detecting, a FiveM script where players sweep the beach with one of five detectors, dig up what they find and sell it.

metal detecting (lation_detecting) sends players to the beach with a metal detector. They walk the sand until a find turns up nearby, follow the beeps and the distance to the spot, and dig it up with a shovel. Five detectors unlock as players level up, each reaching farther and turning up valuable finds more often, and everything they dig up sells at the sell shop. It is set up in config.lua, and every line players read is in strings.lua.

Works on Qbox, QBCore and ESX.

Requirements

ResourceNeededWhat for
oxmysqlRequiredEach player's level, XP and stats
ox_libRequiredCallbacks and shop zones, and the default menus, dialogs, notifications and text prompts
qbx_core, qb-core or es_extendedRequiredPlayers, jobs, money and usable items
An inventoryRequired on Qbox and ESXox_inventory, qb-inventory, qs-inventory, ps-inventory, origen_inventory or codem-inventory. On QBCore, qb-core's own items work too.
ox_target, qb-target or interactOptionalShopkeepers open with a key prompt by default. Set Config.Setup.interact to target them instead. lation interact works as ox_target or qb-target.
lation_uiOptionalMenus, dialogs and notifications in the lation ui look, once you pick it in Config.Setup. The text prompts follow when you pick it in client/functions.lua (text prompts).
okokNotify, sd-notify or wasabi_notifyOptionalOther notification systems
jg-textui or okokTextUIOptionalOther text prompt systems
fmsdk or fm-logsOptionalLogging to Fivemanage or Fivemerr

oxmysql and ox_lib are dependencies in fxmanifest.lua: metal detecting doesn't start without them. The framework and inventory are detected when it starts. The interaction, notification, menu and dialog systems are set in Config.Setup.

Install

Follow the install guide, then:

Keep the folder name lation_detecting. The script calls its own exports by that name, its menus load their pictures from it and the update check looks it up, and a renamed folder prints an error on start and again every 15 minutes.

Add the 52 items and their images to your inventory. The files ship in install/, and the image names match the item names.

Paste the contents of install/items/ox_inventory.txt into ox_inventory/data/items.lua, then copy every file in install/images/ into ox_inventory/web/images/. This is the one to use on Qbox.

Paste the contents of install/items/qb-inventory.txt into qb-core/shared/items.lua, then copy every file in install/images/ into qb-inventory/html/images/.

Paste the contents of install/items/qs-inventory.txt into the item list of qs-inventory, then copy every file in install/images/ into its image folder.

Add the same 52 items in your inventory's own format, with the labels and weights in items below, and copy every file in install/images/ into its image folder. The detectors are made usable through your framework, so nothing else is needed for them.

Leave the install folder where it is. On every start the script reads install/lation_detecting.sql to create its table, and the shop menus show the pictures in install/images/.

Ensure it after its dependencies, your framework and your inventory. If you run lation ui, it goes first, above ox_lib, because the lation ox_lib fork looks for it when ox_lib starts.

server.cfg
ensure lation_ui         # optional
ensure oxmysql
ensure ox_lib
ensure qbx_core          # or qb-core / es_extended
ensure ox_target         # optional: or lation_interact / qb-target / interact
ensure ox_inventory      # your inventory
ensure lation_detecting

Look over config.lua. As it ships, shopkeepers open with a key prompt, and menus, dialogs and notifications use ox_lib. See configuration.

Restart the server.

There is no SQL to import. On every start metal detecting runs install/lation_detecting.sql, which creates the lation_detecting table when it is missing, with one row per player:

ColumnHolds
identifierThe player's ESX identifier, or their citizenid on Qbox and QBCore
levelTheir level, 1 to 5
experienceTheir total XP, which stops at 100,000
items_foundHow many items they've dug up
money_earnedHow much the sell shop has paid them

A player's row is made at level 1 the first time the script looks them up, and kept in memory while they play. It is saved when they leave, when the resource stops and when txAdmin shuts the server down.

Nothing is saved on a timer, so a server crash loses the XP and stats players earned since their last save.

Upgrading from version 1

Version 1 kept levels in a table named metal_detecting. To carry them over, run install/rename_table.sql on your database once, before version 2 starts for the first time. It renames the table to lation_detecting and its player_identifier column to identifier.

If version 2 has already started, it has made its own lation_detecting table and the rename fails. Drop that new table (it only holds what was earned since), run the file, then restart. A server that never ran version 1 doesn't need the file.

What ships with it

  • stream/ holds the five detector props, one color each, and the .ytyp that loads them. They stream with the resource, so there is nothing to install.
  • install/ holds the item files, the 52 item images and the SQL file.
  • config.lua, strings.lua, logs.lua, the two files in bridge/, client/functions.lua and server/functions.lua ship open for you to edit. See open files.

Items

ItemLabelWeightUsable
blue_metaldetectorBeginner's Beacon475Yes, takes out or puts away the detector
green_metaldetectorLustrous Locator475Yes
red_metaldetectorTreasure Trove Tracker475Yes
orange_metaldetectorGoldseeker's Grail475Yes
black_metaldetectorArchaeo Ace475Yes
md_shovelShovel55No, it only has to be carried
46 finds, md_bottlecap to md_presidentialwatchSee finds25 eachNo

Players dig with a key at the spot, not by using the shovel, even though the qb-inventory and qs-inventory files mark it usable.

The qb-inventory and qs-inventory files label five finds differently from the ox_inventory file: md_screw is Rusty Screw, md_blackwatch is Black Watch, and md_diamondearings, md_goldearings and md_silverearings are spelled Earrings. The sell shop shows whichever label your inventory has.

First start

The lation_detecting table is created, and two shopkeepers appear: the detector shop on Vespucci Beach, under the Metal Detectors blip, and the sell shop outside a pawn shop in Downtown Vinewood, under the Detectors Sell Shop blip.

Buy the Beginner's Beacon at the detector shop for $2,750, and a shovel under Buy Shovel at the sell shop for $250. Both take cash.

Use the detector from your inventory on the beach and start walking. See detecting.

Commands

CommandWhoWhat it does
/metaldetectingEveryoneOpens the player's stats: their level, progress to the next one, items found and money earned. Renamed with Config.Setup.command.
/simulateEveryone, while Config.Setup.debug is on/simulate 1 500 rolls 500 finds on the first detector's loot table and prints how many of each item came up in the F8 console. See loot tables.

There are no admin commands or permissions.

Troubleshooting

The console says to rename the folder

The resource folder isn't named lation_detecting. Rename it back and restart; the message repeats every 15 minutes until you do.

The console keeps saying install folder or .sql files missing

install/lation_detecting.sql isn't in the resource folder, so the table can't be created. Put the install folder back from the download and restart. The message repeats every 10 seconds until you do.

The prompt says Error

The player is standing still, running, or not on beach sand. Nothing counts until they walk on sand again. Running counts only with Config.Detecting.running on, and other ground only once you add it: see where players can detect.

Using the shovel from the inventory does nothing

Digging starts with E at the spot, when the prompt says E - Start Digging. The shovel only has to be in the player's inventory.

A player can't buy or use a detector

Each detector needs its level: the Lustrous Locator needs level 2, and so on. /metaldetecting shows the player's level. To let anyone use any detector, set Config.Detecting.verify_level to false.

SQL error: metal_detecting doesn't exist

install/rename_table.sql was run on a server that never had version 1. Nothing needs fixing; that file is only for upgrades.

The F8 console says No interaction system defined in the config file

Config.Setup.interact isn't one of textui, ox_target, qb-target, interact or custom. Set one of them and restart.

The console says Unable to fetch version information from API

The update check couldn't reach the version server. It changes nothing in game. Set Config.Setup.version to false to skip it.

Detecting

Detectors, searching, digging, finds, levels and selling.

Configuration

Every option in config.lua and logs.lua with its default.

Developers

Exports, the notify event, hooks and the open files.

Changelog

Every release since version 2.

Still stuck? Ask in our Discord: the people who write the scripts answer.

Last updated November 12, 2026

Changelog

Every meth crafting release, newest first, with what it added, changed and fixed.

Detecting

How players buy a detector, search the beach, dig up finds, level up and sell in metal detecting, with the default detectors, finds and prices.

On this page

RequirementsInstallUpgrading from version 1What ships with itItemsFirst startCommandsTroubleshooting
lation scripts

FiveM scripts for Qbox, QBCore and ESX servers, made to look and work like one product.

store

  • all scripts
  • membership
  • classics

help

  • docs
  • discord
  • email support

legal

  • terms
  • refunds
  • privacy
© 2026 Lation Labslationscripts.com
  • home
  • scripts
  • membership
  • docs