RSD METAL DETECTOR [ESX][QBCore] by RSDEV




A complete Metal Detector script on ESX and QBCORE
active on a 600-player server, fully optmized

Everything is configurable :

  • faq for players
  • you can add animations
  • add items and loots with random
  • add props
  • minimum and maximum distances can be modified
  • beep volume and mp3 modifiable
  • all distances color modifiable
  • debug mode to test
Config File
Config = {}
Config.core = "ESX" --QBCore or ESX

Config.debug = false -- true to see pop zones and prints

Config.log = false -- true = log, false = no log
Config.webhook = "" -- Discord webhook

Config.removeItem = true
Config.itemName = "metal_detector"

Config.pickup = "Press ~INPUT_PICKUP~ to pick up your treasure"
Config.nothing = "You didn't find anything this time."
Config.dig = "Press ~INPUT_PICKUP~ to dig in"
Config.stopDetectionAndFaq = "Press ~INPUT_VEH_DUCK~ to stop detection, ~INPUT_VEH_SHUFFLE~ for FAQ."
Config.find = "You find : "

Config.FaqText = {
    {"EXTREMELY close zone - BETWEEN 2 and 8m"},
    {"Close zone - BETWEEN 8 and 15m"},
    {"Medium zone - BETWEEN 15 and 25m"},
    {"Distant zone - BETWEEN 25 and 35m"},
    {"FAR zone - BETWEEN 35 and 45m"},
    {"Very FAR zone - More than 45m"},
}

Config.stopKey = 73 -- X     https://docs.fivem.net/docs/game-references/controls/
Config.faqKey = 104 -- H     https://docs.fivem.net/docs/game-references/controls/

Config.Items = {
    { object="item",            amount=1,       name="water",       random=25},
    { object="money",           amount=500,     name="money",       random=50},
    { object="dirtymoney",      amount=500,     name="dirtymoney",  random=100},
}

Config.Props = {
    { name = "prop_box_ammo04a", depth = 1.9 },
    { name = "prop_byard_rowboat1", depth = 2.0 },
    { name = "v_corp_boxpapr1fd", depth = 2.0 },
    { name = "v_res_jewelbox", depth = 1.8 },
    { name = "prop_skid_box_02", depth = 2.2 },
    { name = "prop_byard_rowboat3", depth = 2.0 },
    { name = "prop_poly_bag_money", depth = 1.9 },
    { name = "reh_prop_reh_skeleton_01a", depth = 1.5 },
    { name = "v_corp_lngestoolfd", depth = 1.5 },
    { name = "prop_skid_trolley_2", depth = 1.5 },
    { name = "v_ilev_mr_rasberryclean", depth = 1.5 },
}

Config.bonesOffsets = {
    ["w_am_digiscanner"] = {
        bone = 18905,
        offset = vector3(0.15, 0.1, 0.0),
        rotation = vector3(270.0, 90.0, 80.0),
    },
}

Config.propAttachments = {
    ["prop_cs_trowel"] = {
        bone = 57005, 
        offset = vector3(0.1, 0.01, -0.03), 
        rotation = vector3(130, 70, -5),
        animDict = "amb@world_human_gardener_plant@female@base", 
        animName = "base_female"
    },
    ["prop_tool_pickaxe"] = {
        bone = 57005, 
        offset = vector3(0.09, -0.03, -0.02), 
        rotation = vector3(-55.23, 0.0, 0.0),
        animDict = "melee@large_wpn@streamed_core", 
        animName = "ground_attack_on_spot"
    },
    ["prop_tool_shovel2"] = {
        bone = 28422, 
        offset = vector3(0.0, -0.1, -0.85), 
        rotation = vector3(0.0, 0.0, 0.0),
        animDict = "random@burial", 
        animName = "a_burial"
    },
}

-- Don't touch anything if you don't know what you're doing

Config.targMin = 10 -- min distance to the player
Config.targMax = 70 -- max distance to the player
Config.volume = 0.5 -- beep volume between 0 to 1 (0 = mute)
Config.maxMarkerSize = 1.2 -- drawmarker size Max
Config.minMarkerSize = 0.2 -- drawmarker size Min

Config.pulseAndSound = {
    { -- above 45m
        color = {255, 255, 255}, -- Gray
        sizeChangeRate = 0.01,
        frequency = 3250 -- Very slow beep
    }, 
    { -- between 35 and 45m
        distanceToZone = 45.0,
        color = {0, 255, 240}, -- Blue
        sizeChangeRate = 0.02,
        frequency = 2500 -- Very slow beep
    }, 
    { -- between 25 and 35m
        distanceToZone = 35.0,
        color = {62, 193, 0}, -- Green
        sizeChangeRate = 0.03,
        frequency = 1500 -- Slow beep
    }, 
    { -- between 15 and 25m
        distanceToZone = 25.0,
        color = {255, 245, 0}, -- Yellow
        sizeChangeRate = 0.04,
        frequency = 1000 -- beep
    }, 
    { -- between 8 and 15m
        distanceToZone = 15.0,
        color = {255, 184, 0}, -- Orange
        sizeChangeRate = 0.05,
        frequency = 850 -- Medium beep
    }, 
    { -- between 2 and 8m
        distanceToZone = 8.0,
        color = {255, 0, 0}, -- Red
        sizeChangeRate = 0.08,
        frequency = 750 -- Fast beep
    }, 
    { -- between 0 and 2m
        distanceToZone = 2.0,
        color = {255, 0, 0}, -- Red
        frequency = 500 -- Very fast beep
    }, 
}

YOUTUBE VIDEO
YOUTUBE VIDEO WITH beep Sound

TEBEX STORE
TEBEX STORE OPEN SOURCE

Other FiveM & RedM Resources

FiveM
:fire: - RSD TRESOR DIVING
:fire: - RSD PauseMenu NUI with REPORT
:fire: - RSD PauseMenu NUI
:fire: - RSD SkyDiving NUI
:fire: - RSD WindSurf
:fire: - RSD LoadingScreen
:fire: - RSD WashMachine NUI
:fire: - RSD Interact
:fire: - RSD Advent Calendar NUI

MLO & MAPPING
:fire: - RSD[MLO] Vespucci - Chicago Street [Hood] :fire:
:fire: - RSD[MLO] Little-Seoul Mafia/Yakuza/Triad V2
:fire: - RSD[MLO] Banham Montain Complex
:fire: - RSD[MLO] Kortz Center Bunker
:fire: - RSD[MLO] Luckywheels Motorcycle
:fire: - RSD[MLO] Seoul Base
:fire: - RSD[MLO] Secret Base
:fire: - RSD[MLO] Paleto Bay Church
:fire: - RSD[MLO] Rancho Aztecas

And more …

Code is accessible Yes/No
Subscription-based No
Lines (approximately) 1000
Requirements ESX or QB
Support Yes
1 Like

@RSDEV rsdev How about the fantastic idea of embarking on a thrilling adventure with compact cars?

Picture this: our team, each in their own small vehicle, navigating diverse locations to discover hidden treasures.

It adds an exciting twist to the journey, making it a unique and unforgettable experience for everyone involved!

1 Like

Ahah i love that xD
We’re in the middle of developing Sea of Thieves-style treasure quests for our server and here too.
But your idea would be a lot of fun.

Any time need something in 3d for it hook me up! @RSDEV