[QB-CORE] Metal Detecting

Preview Video

Purchase here


Features

  • A Metal Detecting Script for QB-Core That Gives Common and Rare Items That You Can Sell
  • Easily Move All Locations via the Config File
  • Easily Add Your Own Detecting Locations via the Config File
  • Add Your Own Items to Be Found and Sold via the Config File and Menus File
  • Useable Metal Detector and Rake to Search for Items
  • Chance for Metal Detector to Overheat
  • Toggle Sounds Being Played When Items Are Found [Requires Interact-Sound]
  • Secure Server Events with Item Checks to Prevent Abuse and Exploits
  • Extensive Config File Where You Can Make Multiple Changes to Suit Your Server Needs

8 Locations To Search By Default

  • Vespucci Beach
  • Vespucci Pier Beach
  • Great Ocean Highway Beach
  • Zancudo Swamp
  • Paleto Beach
  • Los Santos Airport Beach
  • Cypress Flats Beach

12 Common Items To Be Found

  • Coins
  • Pull Tab
  • Aluminum Can
  • Tin Can
  • Keys
  • Rusty Nail
  • Bottle Cap
  • Cutlery
  • Belt Buckle
  • Bullet Casings
  • Metal Chain
  • Metal Scrap

8 Rare Items To Be Found

  • Gold Ring
  • Gold Watch
  • Silver Watch
  • Silver Necklace
  • Ancient Coin
  • Gold Nugget
  • Pocket Watch
  • Diamond Ring

Supported Scripts

Notifications

  • qb-core Notify
  • okokNotify
  • mythic_notify
  • boii_ui notify

Menus

  • qb-menu
  • jixel-menu
  • ox_lib context menu

Targets

  • qb-target
  • ox_target

Inventories

  • qb-inventory
  • ox_inventory


DEPENDENCIES

Config Preview


SCRIPT SUPPORT VIA DISCORD

Config Preview

Config = {}


--
--β–ˆβ–ˆβ•—β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—
--β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β•šβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘
--β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β–‘β–ˆβ–ˆβ•‘
--β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β•šβ•β•β•β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β•šβ–ˆβ–ˆβ•”β•β–‘β–‘β–‘β•šβ•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
--β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ•β•β•β•β–ˆβ–ˆβ•‘
--β•šβ•β•β•β•β•β•β•β–‘β•šβ•β•β•β•β•β•β–‘β•šβ•β•β•β•β•β•β–‘β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β–‘β•šβ•β•β•β•β•β–‘β–‘β–‘β–‘β–‘β–‘β•šβ•β•


--Thank you for downloading this script!

--Below you can change multiple options to suit your server needs.


--Debugs polyzones and shows green boxes
Config.DebugPoly = false



--Blip Settings
Config.Blips = {
    {title = 'Metal Detecting Item Seller', colour = 4, id = 605, coords = vector3(-1478.25, -950.77, 10.22), scale = 0.7, useblip = true}, -- BLIP FOR ITEM SELLER
}

Config.CoreSettings = {
    Target = {
        Type = 'qb', -- target script name support for qb-target and ox_target 
        --EDIT TARGETS.LUA TO ADD YOUR OWN CUSTOM TARGET SCRIPT        
        --use 'qb' for qb-target
        --use 'ox' for ox_target
        --use 'custom' for custom target 
    },
    Notify = {
        Type = 'qb', -- notification type, support for qb-core notify, okokNotify, mythic_notify, boii_ui notify and ox_lib notify
        --use 'qb' for default qb-core notify
        --use 'okok' for okokNotify
        --use 'mythic' for myhthic_notify
        --use 'boii' for boii_ui notify
        --use 'ox' for ox_lib notify
        Sound = true, -- use sound for OKOK notifications ONLY
        Length = { Success = 5000, Error = 5000, },
        PlaySoundWhenItemDetected = true, -- plays a sound when an item is detected REQUIRES INTERACT SOUND
    },    
    Menu = {
        Type = 'qb', -- menu script name, support for qb-menu, jixel-menu and ox_lib context menu
        --EDIT MENUS.LUA TO ADD YOUR OWN CUSTOM MENU SCRIPT 
        --use 'qb' for qb-menu
        --use 'jixel' for jixel-menu
        --use 'ox' for ox_lib context menu
        --use 'custom' for your own custom menu
    },
    Inventory = {
        Type = 'qb', -- support for qb-inventory and ox_inventory
        --use 'qb' for qb-inventory 
        --use 'ox' for ox_inventory
    },
    OverHeat = {
        OverHeatChance = 25, -- chance for metal detctor to over heat
        OverHeatTime =  math.random(10000,20000), -- time in MS for the overheating cooldown before being allowed to detect again
    },
}

-- XP settings
Config.XP = { -- use xp
    Enabled = true, -- Toggles xp system on or off; true = on, false = off
    Command = true, -- Toggles commands on or off use /drugxp or whatever you have named the metadata
    MetaDataName = 'detectingxp', -- The name of your xp if you edit this make sure to also edit the line you added into qb-core/server/player.lua
    Levels = { -- Change your xp requirements here to suit your server set these as high as you want preset xp increase = (xp / 0.8) if changing amounts dont forget to edit server file also where raw_mushroom is given to match new xp amounts
        50, -- level 2 
        100, -- level 3 
        150, -- level 4
        200, -- level 5
        500, -- level 6
        750, -- level 7
        1200, -- level 8
        1500, -- level 9
        1750, -- level 10
        2500, -- level 11  
    }
}

Config.InteractionLocations = {

    ItemSeller = { { Location = vector3(-1478.14, -949.39, 10.22), Width = 0.75, Height = 1.5, Heading = 10, MinZ = 10.0, MaxZ = 12.0, Size = vec3(2.5,1.5,4), Distance = 2.0, Icon = 'fa-solid fa-money-bill', Label = 'Sell Items', }, },

    DetectionZones = {
        [1] = { label = "Vespuci Beach",                zones = { vector2(-1235.3714599609, -1870.3237304688), vector2(-1078.3504638672, -1719.4393310547), vector2(-1109.1394042969, -1707.4836425781), vector2(-1132.0854492188, -1678.9216308594), vector2(-1172.7160644531, -1685.3404541016), vector2(-1210.7575683594, -1717.3157958984), vector2(-1226.0902099609, -1722.1246337891), vector2(-1242.8308105469, -1719.4155273438), vector2(-1252.9659423828, -1710.8187255859), vector2(-1343.2132568359, -1574.150390625), vector2(-1348.9185791016, -1541.6485595703), vector2(-1371.4488525391, -1516.6043701172), vector2(-1366.6671142578, -1492.0660400391), vector2(-1381.0388183594, -1452.1535644531), vector2(-1404.6353759766, -1398.0728759766), vector2(-1399.6550292969, -1374.4416503906), vector2(-1368.5913085938, -1354.6574707031), vector2(-1352.9877929688, -1334.0762939453), vector2(-1348.3785400391, -1314.1878662109), vector2(-1357.4320068359, -1259.5745849609), vector2(-1384.2409667969, -1211.9111328125), vector2(-1370.7957763672, -1182.2463378906), vector2(-1415.6901855469, -1047.5115966797), vector2(-1457.4211425781, -1002.4450073242), vector2(-1494.1760253906, -965.78265380859), vector2(-1556.2160644531, -1032.2530517578), vector2(-1569.1263427734, -1054.8063964844), vector2(-1581.0465087891, -1067.6195068359), vector2(-1586.3592529297, -1067.4575195312), vector2(-1637.1826171875, -1131.3249511719), vector2(-1511.2076416016, -1397.5949707031), vector2(-1514.8392333984, -1448.6328125), vector2(-1492.3695068359, -1509.4837646484) }, },
        [2] = { label = "Vespuci Pier Beach",           zones = { vector2(-1722.8040771484, -1074.9899902344), vector2(-1670.6586914062, -1016.7202758789), vector2(-1674.8736572266, -986.30731201172), vector2(-1666.7580566406, -963.97772216797), vector2(-1711.5971679688, -948.87677001953), vector2(-1733.9592285156, -906.21032714844), vector2(-1726.3951416016, -887.40710449219), vector2(-1675.0350341797, -828.80462646484), vector2(-1665.6284179688, -812.06939697266), vector2(-1744.1295166016, -741.92864990234), vector2(-1852.7572021484, -650.703125), vector2(-1997.1059570312, -526.44879150391), vector2(-2078.2160644531, -458.12603759766), vector2(-2060.5930175781, -423.50311279297), vector2(-2116.080078125, -381.8733215332), vector2(-2154.9704589844, -421.86380004883), vector2(-2196.0407714844, -423.21743774414), vector2(-2202.5512695312, -402.4987487793), vector2(-2225.6103515625, -380.89947509766), vector2(-2242.728515625, -365.99438476562), vector2(-2263.875, -354.01013183594), vector2(-2293.7475585938, -380.27960205078), vector2(-2281.1145019531, -412.58135986328), vector2(-2180.2150878906, -474.93695068359), vector2(-2125.1369628906, -560.09912109375), vector2(-1825.4530029297, -979.37664794922), vector2(-1799.326171875, -1008.2298583984) }, },
        [3] = { label = "Great Ocean Highway Beach",    zones = { vector2(-2849.1911621094, -9.3616704940796), vector2(-2864.6374511719, -15.925931930542), vector2(-2939.9892578125, 5.7179131507874), vector2(-3000.876953125, 35.169189453125), vector2(-3012.8137207031, 16.242261886597), vector2(-3029.4553222656, 19.039121627808), vector2(-3055.11328125, 32.299152374268), vector2(-3060.6557617188, 54.031044006348), vector2(-3048.6411132812, 69.36434173584), vector2(-3067.0334472656, 89.109313964844), vector2(-3069.578125, 108.42459106445), vector2(-3065.6394042969, 176.72752380371), vector2(-3045.2697753906, 177.84524536133), vector2(-3051.7846679688, 210.0806427002), vector2(-3067.7478027344, 218.86016845703), vector2(-3092.3566894531, 240.01240539551), vector2(-3122.3564453125, 279.19064331055), vector2(-3104.4411621094, 368.82965087891), vector2(-3094.3588867188, 413.77932739258), vector2(-3067.5500488281, 405.82382202148), vector2(-3079.7573242188, 444.28070068359), vector2(-3062.4250488281, 479.61825561523), vector2(-3058.3088378906, 526.40881347656), vector2(-3056.7194824219, 562.65942382812), vector2(-3057.3542480469, 591.45483398438), vector2(-3073.0087890625, 634.48370361328), vector2(-3092.6860351562, 655.65710449219), vector2(-3116.7497558594, 707.59429931641), vector2(-3116.0549316406, 751.52954101562), vector2(-3109.0405273438, 773.11383056641), vector2(-3163.3576660156, 853.41784667969), vector2(-3189.919921875, 899.57159423828), vector2(-3237.0209960938, 908.1064453125), vector2(-3256.7739257812, 941.88983154297), vector2(-3287.3591308594, 960.54754638672), vector2(-3306.9404296875, 960.64501953125), vector2(-3301.7041015625, 931.06127929688), vector2(-3266.9829101562, 907.15197753906), vector2(-3250.6220703125, 875.96142578125), vector2(-3248.8479003906, 838.18542480469), vector2(-3172.6369628906, 705.71875), vector2(-3139.6127929688, 662.23413085938), vector2(-3118.5642089844, 623.13940429688), vector2(-3106.1887207031, 569.44445800781), vector2(-3104.3486328125, 525.40856933594), vector2(-3115.2182617188, 430.79019165039), vector2(-3141.2790527344, 379.00421142578), vector2(-3163.2731933594, 320.54220581055), vector2(-3172.9489746094, 265.77130126953), vector2(-3133.8410644531, 203.77096557617), vector2(-3115.3518066406, 140.2215423584), vector2(-3109.0114746094, 67.520568847656), vector2(-3071.3264160156, 18.675680160522), vector2(-3019.3146972656, -14.107211112976), vector2(-2970.4086914062, -30.87726020813), vector2(-2921.7653808594, -48.735790252686), vector2(-2879.9924316406, -50.749179840088), vector2(-2845.7067871094, -50.212188720703), vector2(-2786.5583496094, -89.21590423584), vector2(-2729.5678710938, -121.96012115479), vector2(-2659.3330078125, -189.48748779297), vector2(-2558.109375, -259.51315307617), vector2(-2465.8857421875, -317.53662109375), vector2(-2380.2075195312, -348.40280151367), vector2(-2313.0490722656, -384.7678527832), vector2(-2300.6291503906, -395.05349731445), vector2(-2278.6760253906, -344.94323730469), vector2(-2315.3459472656, -333.51257324219), vector2(-2365.5920410156, -296.43099975586), vector2(-2458.2641601562, -241.97805786133), vector2(-2526.1374511719, -208.36817932129), vector2(-2637.6650390625, -127.92098999023), vector2(-2698.9272460938, -56.013748168945), vector2(-2762.1892089844, 1.6146454811096), vector2(-2805.1042480469, 26.29829788208), vector2(-2847.49609375, 38.992660522461) }, },
        [4] = { label = "Zancudo Swamp",                zones = { vector2(-2668.2829589844, 2375.1752929688), vector2(-2691.0905761719, 2314.0524902344), vector2(-2663.6584472656, 2300.9423828125), vector2(-2582.5920410156, 2334.9213867188), vector2(-2568.6779785156, 2354.6376953125), vector2(-2527.8195800781, 2354.4406738281), vector2(-2508.8986816406, 2331.2451171875), vector2(-2473.8217773438, 2323.5275878906), vector2(-2416.0700683594, 2294.4943847656), vector2(-2359.3125, 2264.8764648438), vector2(-2304.103515625, 2262.7607421875), vector2(-2259.5100097656, 2291.7082519531), vector2(-2220.6831054688, 2319.326171875), vector2(-2179.1740722656, 2320.3781738281), vector2(-2142.7697753906, 2317.9943847656), vector2(-2099.0532226562, 2321.3334960938), vector2(-2053.3610839844, 2336.9782714844), vector2(-2000.6722412109, 2358.6596679688), vector2(-1943.0104980469, 2374.025390625), vector2(-1872.0233154297, 2392.6208496094), vector2(-1821.4827880859, 2406.1638183594), vector2(-1758.0765380859, 2438.216796875), vector2(-1694.1541748047, 2446.8684082031), vector2(-1605.9486083984, 2423.3439941406), vector2(-1539.5400390625, 2411.2182617188), vector2(-1398.1522216797, 2431.1379394531), vector2(-1330.1492919922, 2470.7568359375), vector2(-1305.1488037109, 2509.9831542969), vector2(-1339.2144775391, 2554.7763671875), vector2(-1373.9942626953, 2586.4445800781), vector2(-1459.4061279297, 2658.0424804688), vector2(-1533.8271484375, 2725.5510253906), vector2(-1588.5914306641, 2767.1791992188), vector2(-1623.1688232422, 2803.9555664062), vector2(-1654.8161621094, 2847.6875), vector2(-1676.0903320312, 2868.8081054688), vector2(-1705.6280517578, 2822.1545410156), vector2(-1759.2370605469, 2806.9030761719), vector2(-1799.5313720703, 2805.1330566406), vector2(-1825.4327392578, 2768.5598144531), vector2(-1859.0219726562, 2763.6831054688), vector2(-1951.5927734375, 2789.0102539062), vector2(-2017.6033935547, 2805.5942382812), vector2(-2063.3911132812, 2794.7583007812), vector2(-2072.451171875, 2787.1328125), vector2(-2075.2067871094, 2785.7048339844), vector2(-2111.2517089844, 2787.8349609375), vector2(-2109.9221191406, 2796.5727539062), vector2(-2136.2185058594, 2799.3920898438), vector2(-2135.4875488281, 2811.3684082031), vector2(-2147.1923828125, 2814.0078125), vector2(-2153.4008789062, 2840.1047363281), vector2(-2210.3286132812, 2874.3994140625), vector2(-2265.095703125, 2910.2856445312), vector2(-2319.4426269531, 2932.2307128906), vector2(-2371.9252929688, 2935.3129882812), vector2(-2419.8940429688, 2912.5676269531), vector2(-2448.4599609375, 2892.2976074219), vector2(-2494.7998046875, 2918.7915039062), vector2(-2527.0263671875, 2993.1208496094), vector2(-2592.0822753906, 2966.4423828125), vector2(-2631.3623046875, 2979.7314453125), vector2(-2697.5856933594, 3049.6179199219), vector2(-2776.2661132812, 3032.5861816406), vector2(-2759.9138183594, 2970.2426757812), vector2(-2758.9055175781, 2869.6691894531), vector2(-2778.6452636719, 2763.9501953125), vector2(-2788.7099609375, 2700.2375488281), vector2(-2761.4523925781, 2685.8505859375), vector2(-2733.1098632812, 2657.4309082031), vector2(-2733.5939941406, 2578.3674316406), vector2(-2781.5559082031, 2553.1484375), vector2(-2807.8913574219, 2505.91015625), vector2(-2801.5004882812, 2426.7312011719), vector2(-2819.6887207031, 2357.5339355469), vector2(-2863.5854492188, 2290.96875), vector2(-2859.935546875, 2254.7731933594), vector2(-2816.9819335938, 2266.1252441406) }, },
        [5] = { label = "Paleto Beach",                 zones = { vector2(1348.2899169922, 6637.9287109375), vector2(1336.1112060547, 6579.4892578125), vector2(1351.0482177734, 6521.4140625), vector2(1277.4134521484, 6509.3334960938), vector2(749.21148681641, 6521.0595703125), vector2(522.72424316406, 6573.61328125), vector2(430.31671142578, 6590.8510742188), vector2(417.24710083008, 6634.1489257812), vector2(394.34634399414, 6665.00390625), vector2(228.21392822266, 6673.2026367188), vector2(208.55661010742, 6646.6430664062), vector2(202.97402954102, 6639.4677734375), vector2(181.31018066406, 6643.2895507812), vector2(157.46955871582, 6669.7094726562), vector2(145.83464050293, 6656.638671875), vector2(118.10949707031, 6661.099609375), vector2(91.168426513672, 6651.263671875), vector2(62.789520263672, 6668.9692382812), vector2(14.066328048706, 6687.0126953125), vector2(-11.776723861694, 6682.8237304688), vector2(-62.945476531982, 6659.7158203125), vector2(-78.658309936523, 6628.6728515625), vector2(-102.40027618408, 6593.4252929688), vector2(-134.60873413086, 6575.0932617188), vector2(-145.08570861816, 6543.265625), vector2(-159.72592163086, 6518.25390625), vector2(-188.91612243652, 6474.6401367188), vector2(-207.26063537598, 6483.6098632812), vector2(-242.94845581055, 6441.8715820312), vector2(-264.75341796875, 6419.9409179688), vector2(-305.55041503906, 6391.146484375), vector2(-354.48077392578, 6360.0180664062), vector2(-354.48077392578, 6360.0180664062), vector2(-395.93521118164, 6330.60546875), vector2(-433.76718139648, 6304.4453125), vector2(-456.64923095703, 6263.9301757812), vector2(-471.71978759766, 6218.8432617188), vector2(-470.31161499023, 6177.5009765625), vector2(-463.70999145508, 6140.7822265625), vector2(-493.19815063477, 6102.4228515625), vector2(-536.8603515625, 6071.7529296875), vector2(-583.99359130859, 6114.6650390625), vector2(-665.36352539062, 6150.7104492188), vector2(-664.91607666016, 6235.0473632812), vector2(-651.04187011719, 6334.5161132812), vector2(-596.06555175781, 6404.9750976562), vector2(-513.01141357422, 6450.9057617188), vector2(-435.86297607422, 6490.0458984375), vector2(-372.68966674805, 6526.9521484375), vector2(-311.32489013672, 6582.9194335938), vector2(-269.64263916016, 6657.9116210938), vector2(-204.29475402832, 6693.708984375), vector2(-147.08955383301, 6735.046875), vector2(-83.75106048584, 6830.15234375), vector2(-38.567043304443, 6955.3740234375), vector2(35.901836395264, 7098.9135742188), vector2(38.421337127686, 7241.94921875), vector2(81.790603637695, 7245.99609375), vector2(176.23014831543, 7101.4252929688), vector2(284.35375976562, 7013.73046875), vector2(377.0358581543, 6947.9013671875), vector2(415.57788085938, 6877.11328125), vector2(470.84985351562, 6773.76953125), vector2(571.36437988281, 6724.4428710938), vector2(713.70611572266, 6665.7866210938), vector2(819.46826171875, 6677.7250976562), vector2(896.14910888672, 6658.4594726562), vector2(976.16400146484, 6631.3168945312), vector2(1077.1431884766, 6633.7504882812), vector2(1144.1735839844, 6607.6069335938), vector2(1241.8072509766, 6620.9555664062) }, },
        [6] = { label = "Los Santos Airport Beach",     zones = { vector2(-841.36108398438, -1689.7027587891), vector2(-1042.5504150391, -1888.2839355469), vector2(-1102.4447021484, -1945.0170898438), vector2(-1113.8891601562, -1950.8585205078), vector2(-1142.8793945312, -1950.7510986328), vector2(-1161.9188232422, -1964.4215087891), vector2(-1180.4134521484, -1997.609375), vector2(-1203.1120605469, -2044.1822509766), vector2(-1214.6591796875, -2077.12109375), vector2(-1236.146484375, -2074.9624023438), vector2(-1256.6656494141, -2106.2971191406), vector2(-1271.9528808594, -2117.2126464844), vector2(-1296.3660888672, -2111.5290527344), vector2(-1319.1574707031, -2136.0256347656), vector2(-1356.8978271484, -2145.5969238281), vector2(-1378.6176757812, -2158.3413085938), vector2(-1412.9708251953, -2214.4770507812), vector2(-1451.8950195312, -2284.8957519531), vector2(-1503.9526367188, -2374.21875), vector2(-1560.7390136719, -2471.8833007812), vector2(-1605.1628417969, -2549.5793457031), vector2(-1639.4526367188, -2607.7214355469), vector2(-1675.8659667969, -2670.9943847656), vector2(-1695.4879150391, -2697.5412597656), vector2(-1710.1032714844, -2706.0490722656), vector2(-1722.8586425781, -2702.0158691406), vector2(-1736.6354980469, -2725.8232421875), vector2(-1747.5753173828, -2726.9645996094), vector2(-1767.9301757812, -2717.0134277344), vector2(-1788.1616210938, -2721.9047851562), vector2(-1793.8619384766, -2728.716796875), vector2(-1925.7788085938, -2957.3374023438), vector2(-1978.8726806641, -3050.2309570312), vector2(-1906.9848632812, -3089.314453125), vector2(-1949.4228515625, -3157.9592285156), vector2(-1824.9344482422, -3229.3210449219), vector2(-1778.8947753906, -3158.1103515625), vector2(-1408.7395019531, -3373.3225097656), vector2(-1401.0089111328, -3381.1484375), vector2(-1258.8725585938, -3459.9311523438), vector2(-1254.4586181641, -3501.9438476562), vector2(-1291.7474365234, -3511.0322265625), vector2(-1339.521484375, -3471.1787109375), vector2(-1418.0155029297, -3450.1052246094), vector2(-1505.4979248047, -3417.1770019531), vector2(-1593.4002685547, -3394.0046386719), vector2(-1675.4573974609, -3360.8479003906), vector2(-1745.5776367188, -3328.3039550781), vector2(-1821.4233398438, -3294.7858886719), vector2(-1902.3045654297, -3239.013671875), vector2(-1963.8112792969, -3192.7265625), vector2(-1997.0825195312, -3050.0419921875), vector2(-1998.1158447266, -3006.1821289062), vector2(-1960.0855712891, -2930.1005859375), vector2(-1923.5441894531, -2867.4665527344), vector2(-1893.1867675781, -2808.8591308594), vector2(-1866.9111328125, -2738.5656738281), vector2(-1798.2307128906, -2642.9370117188), vector2(-1767.6433105469, -2583.8872070312), vector2(-1736.1359863281, -2523.0590820312), vector2(-1668.8575439453, -2416.0031738281), vector2(-1613.8922119141, -2309.8884277344), vector2(-1569.1739501953, -2232.2409667969), vector2(-1489.0101318359, -2183.5185546875), vector2(-1402.3428955078, -2125.0122070312), vector2(-1346.8458251953, -2065.5544433594), vector2(-1296.4405517578, -2035.8352050781), vector2(-1258.6511230469, -1987.544921875), vector2(-1202.4631347656, -1940.8425292969), vector2(-1170.8253173828, -1899.6550292969), vector2(-1132.9624023438, -1863.8673095703), vector2(-1044.5903320312, -1834.6273193359), vector2(-989.07470703125, -1806.9260253906), vector2(-926.6845703125, -1743.9522705078), vector2(-866.04528808594, -1662.5295410156) }, },
        [7] = { label = "Cypress Flats Beach",          zones = { vector2(830.57928466797, -2588.5339355469), vector2(915.59875488281, -2594.2546386719), vector2(1003.0067138672, -2602.4953613281), vector2(1057.8458251953, -2606.7036132812), vector2(1059.0187988281, -2596.8811035156), vector2(1103.8342285156, -2587.8977050781), vector2(1147.5413818359, -2582.3195800781), vector2(1164.0560302734, -2594.4619140625), vector2(1266.6358642578, -2662.8286132812), vector2(1345.8138427734, -2681.392578125), vector2(1396.9362792969, -2704.3784179688), vector2(1446.6038818359, -2723.4150390625), vector2(1494.0244140625, -2703.45703125), vector2(1546.1307373047, -2701.998046875), vector2(1588.9814453125, -2711.9619140625), vector2(1701.7336425781, -2672.1423339844), vector2(1739.0169677734, -2669.2202148438), vector2(1792.6339111328, -2688.4321289062), vector2(1804.8576660156, -2679.8676757812), vector2(1840.1179199219, -2677.1384277344), vector2(1883.8254394531, -2660.0983886719), vector2(1908.7036132812, -2644.5717773438), vector2(1923.4674072266, -2620.5817871094), vector2(1949.8366699219, -2606.5771484375), vector2(1954.9916992188, -2622.8244628906), vector2(1912.1274414062, -2673.8332519531), vector2(1817.1979980469, -2725.9528808594), vector2(1805.6260986328, -2736.5053710938), vector2(1739.3356933594, -2714.1887207031), vector2(1681.5493164062, -2708.6142578125), vector2(1626.1776123047, -2726.7177734375), vector2(1598.1394042969, -2751.5629882812), vector2(1561.0086669922, -2760.9262695312), vector2(1460.9545898438, -2773.8486328125), vector2(1423.1162109375, -2783.3129882812), vector2(1388.6696777344, -2764.169921875), vector2(1350.6239013672, -2749.552734375), vector2(1306.4046630859, -2754.8220214844), vector2(1280.5822753906, -2747.5900878906), vector2(1241.9390869141, -2721.7485351562), vector2(1202.5263671875, -2706.0756835938), vector2(1151.6687011719, -2697.3400878906), vector2(1105.6864013672, -2694.533203125), vector2(1053.1973876953, -2685.6401367188), vector2(1003.7905273438, -2683.8771972656), vector2(982.92749023438, -2683.4895019531), vector2(903.70666503906, -2639.8342285156), vector2(879.34906005859, -2632.2888183594) }, },
        [8] = { label = "Golf Course",                  zones = { vector2(-1328.1413574219, 23.641500473022), vector2(-1325.1188964844, 15.821513175964), vector2(-1305.1805419922, -11.207995414734), vector2(-1286.8530273438, -37.072483062744), vector2(-1226.5502929688, -66.809638977051), vector2(-1169.8522949219, -98.574172973633), vector2(-1086.0903320312, -142.31829833984), vector2(-1053.4461669922, -145.16979980469), vector2(-1021.7653198242, -132.69921875), vector2(-996.98864746094, -130.78244018555), vector2(-964.23681640625, -119.91135406494), vector2(-941.72198486328, -107.1351852417), vector2(-925.39422607422, -95.608818054199), vector2(-922.53747558594, -86.838394165039), vector2(-928.14324951172, -74.67008972168), vector2(-978.17291259766, -6.6645956039429), vector2(-1003.4943237305, 37.786014556885), vector2(-1027.1616210938, 78.947418212891), vector2(-1059.7103271484, 129.27760314941), vector2(-1085.3151855469, 171.60905456543), vector2(-1100.8764648438, 212.72212219238), vector2(-1113.541015625, 236.73222351074), vector2(-1137.8463134766, 234.39149475098), vector2(-1183.1171875, 219.38301086426), vector2(-1217.2086181641, 211.79742431641), vector2(-1250.5971679688, 201.65370178223), vector2(-1296.0963134766, 195.93698120117), vector2(-1332.423828125, 192.69856262207), vector2(-1365.6650390625, 183.81758117676), vector2(-1394.3239746094, 161.48217773438), vector2(-1410.2670898438, 118.4850769043), vector2(-1412.3663330078, 101.31017303467), vector2(-1402.8619384766, 97.694374084473), vector2(-1385.8516845703, 110.16625213623), vector2(-1388.2923583984, 139.80712890625), vector2(-1388.0981445312, 144.51780700684), vector2(-1379.1820068359, 145.74349975586), vector2(-1351.3103027344, 148.42643737793), vector2(-1343.8676757812, 144.64781188965), vector2(-1341.2164306641, 127.37368774414), vector2(-1348.3676757812, 122.34342956543) }, },
    },
}



Config.Items = {
    
    ChanceToFindItems = 75, -- chance to find an item when detecting
    CommonChance = 75, -- chance to find common items instead of rare ones - THE LOWER THIS NUMBER THE MORE LIKELY YOU ARE TO FIND RARE ITEMS - SET TO AROUND 75 TO BE FAIR BETWEEN COMMON AND RARE ITEMS
    ItemAmount = math.random(1,3), -- amount of EACH item found when detecting EXAMPLE = 3x belt buckle

    CommonItems = { 'coins', 'pulltab', 'aluminumcan', 'tincan', 'keys', 'rustynail', 'bottlecap', 'cutlery', 'beltbuckle', 'bulletcasings', 'metalchain', 'metalscrap', },    
    RareItems   = { 'goldring', 'goldwatch', 'silverwatch', 'silvernecklace', 'ancientcoin', 'goldnugget', 'pocketwatch', 'diamond_ring', },
}

Config.Selling = {

    CashSymbol = 'Β£', -- cah symbol used in server

    CommonItems = {
        ["coins"] =  2, -- price of EACH item
        ["pulltab"] =  1, -- price of EACH item
        ["aluminumcan"] =  2, -- price of EACH item
        ["tincan"] =  2, -- price of EACH item
        ["keys"] =  2, -- price of EACH item
        ["rustynail"] =  1, -- price of EACH item
        ["bottlecap"] =  1, -- price of EACH item
        ["cutlery"] =  1, -- price of EACH item
        ["beltbuckle"] =  2, -- price of EACH item
        ["bulletcasings"] =  2, -- price of EACH item
        ["metalchain"] =  2, -- price of EACH item
        ["metalscrap"] =  2, -- price of EACH item
    },
    RareItems = {
        ["goldring"] =  10, -- price of EACH item
        ["goldwatch"] =  10, -- price of EACH item
        ["silverwatch"] =  15, -- price of EACH item
        ["silvernecklace"] =  15, -- price of EACH item
        ["ancientcoin"] =  20, -- price of EACH item
        ["goldnugget"] =  25, -- price of EACH item
        ["pocketwatch"] =  25, -- price of EACH item
        ["diamond_ring"] =  50, -- price of EACH item
    },
}




Check Out My Other Scripts Below

Job Scripts


Activities Scripts


Drug Scripts


Script Bundles

Free Scripts

Code is accessible Yes ALL / OS
Subscription-based No
Lines (approximately) 1000+
Requirements qb-core, qb-target, qb-menu, qb-inventory, qb-input polyzone, interact sound, ox_lib
Support Yes

SCRIPT UPDATE

Metal Detecting
Version 1.1.0

  • Complete refactor of code for easier configuration and editing with new config layout

  • New files inside SHARED folder for configuration: config.lua, menus.lua, targets.lua

  • Support added for ox_target and ox_lib context menu

  • Improved the calculations for metal detector overheating and the length of time it takes to cool down

  • Improved the rewards table and chances to get common and rare items

  • Removed the need for RP/DP Emotes [all animations are now done natively instead]

Does this support ox_inv?

not currently, coming in a future update though across ALL scripts

Very good video with lots of information and showcases. :+1: :heart:

1 Like

thank you for your kind words, I try and explain as much as I can in a short video :stuck_out_tongue:

1 Like

Metal Detecting
Version 1.2.0

  • Complete refactor of code with major improvements
  • Added support for ox_inventory
  • Major quality of life improvements to aid in performance
  • Re-written some functions & events to aid in performance
  • New minigame for metal detecting
  • Improvements to rewards given from detecting
  • Chances to find common and rare items
  • Added XP system
  • New selling system
  • Added an option to buy metal detector from item seller store
  • Removed the β€˜RAKE’ item as it was just repeated code and unnecessary

Script Update
Version 1.2.1

  • re-wrote selling method for better performance and to remove duplicate code
  • improved target location for item seller
  • removed option to buy metal detector from item seller - now need to add your own methods of obtaining detector
  • improved code for target location and added it to metaldetecting_client file instead
  • removed the file named targets.lua as its not needed anymore
  • improved the animation for scanning and digging items
1 Like

Script Update

Version 2.0.0

  • Refactored code to improve performance
  • Improved notification function to prevent duplicate code
  • Improved config file for a better understanding
  • Added Config.Animations for easier configuration for custom anims etc
  • Improved ped spawns and added local entity for targets
  • Improved chance for metal detector to overheat
  • Utilised lib.skillcheck and lib.progresscircle for events for a cleaner UI with more options
  • Added metal safe as a special item the player can dig up, get a drill and then attempt to open the safe for a chance to get cash
  • useable metal safe that places an object for the player to interact with
  • Improved checks for various events for security and to prevent exploits or abuse
  • Improved resource stopping event
  • Improved useable items to prevent repeat code
  • Improved callbacks for item checks and amounts
  • Majorly improved reward system from detecting items and chances to find category items
  • Various other QOL improvements
  • Updated README file
  • Improved checks for ox_inventory can carry items

Script Update

Version 2.0.1

  • Added direct support for latest qb-inventory methods removing the use of Player.Functions.Add/Remove Items
  • Updated README file and included item list for ox_inventory
  • Added Config.Blips for detecting zones
  • Added Config.SafeContents with configurable options for items or cash from opening metal safe
  • Added Config.Language for custom translations
  • Added Config.Chances for easier configuration of luck in events
  • Changed safe model and improved animation
  • Impoved target options for metal safe
  • Added item images to menu
  • Improved how items are given and removed for better performance and increased security
  • Imrpoved XP functions and return amounts to reduce code
  • Various other QOL features and improvements
  • Removed support for qb-menu as ox_lib has more features