[ESX, QB, ANY F.W] Realistic Metal Detecting

showcase

ScriptsM Metal Detecting

This script allows you to walk with metal detector and find items underground. Metal detector prop have realtime screen, that shows VDI(Visual Discrimination Indication) and distance to metal object(Configurable). When digging, a hole appears and an item that you can pick up(Configurable).

Features

  • Find metallic items with metal detector

  • Custom metal detector prop with distance to metal item and sensitivity indicators on prop

  • VDI(Visual Discrimination Indication) on the display like in real metal detectors. Find out what’s underground before digging up. An ordinary coin, a cork, or an expensive golden ring!

  • Custom detector sounds vary depending on the distance. Can be hear by other players

  • Dig up finded items with a shovel. When digging, a hole appears and an item that can be picked up. Shovel looses durability

  • Custom metal detector and sand hole model included

  • Custom metal detector sounds and inventory item icons included

  • Different search zones and different items that can be found in them.

  • Script is fully configurable and optimized in all scenarios (0.01ms)

Configuration File


Config.Framework = 'esx' -- esx/qb

Config.ShovelMinusDur = 10 -- Shovel duration minus
Config.ShovelName = 'shovel' -- Shovel inventory name
Config.DetectorName = 'metaldetector' -- Detector inventory name

Config.UseBlips = true -- Use zone blips?
Config.BlipSprite = 587 -- Can be found here: https://docs.fivem.net/docs/game-references/blips/
Config.BlipColor = 6 -- Can be found here: https://docs.fivem.net/docs/game-references/hud-colors/
Config.BlipText = 'Metal detecting' -- Blip text

Config.UseVid = false -- Use VID(Visual Discrimination Indication) or show distance in center of screen?

Config.AllowRun = true -- Allow run when holding metal detector?

-- Stage distance
Config.Stage1 = 40
Config.Stage2 = 30
Config.Stage3 = 25
Config.Stage4 = 20
Config.Stage5 = 15
Config.Stage6 = 10
Config.Stage7 = 5
Config.Stage8 = 3
Config.Stage9 = 1

Config.MaxSpawnRadius = 40 -- Max loot spawn radius
Config.DigoutDistance = 3 -- Allow digging from distance
Config.ZoneFindRadius = 100 -- Zone findout radius by points

Config.UseObjectSystem = true -- Use item pickup system?

Config.TargetSystem = 'ox' -- ox/qb
Config.TargetText = "Pickup Item" -- Target text

Config.Locations = {
	{
		name = "vespucci",
		FirstPoint = vector2(-2105, -554),
		SecondPoint = vector2(-2070, -517),
		ThirdPoint = vector2(-1893, -693),
		FourthPoint = vector2(-1927, -734),
		Center = vector2(-1993, -628),
		loot = "beach-common"
	},
	{
		name = "chumash", -- Name of zone
		FirstPoint = vector2(-3089, 525),
		SecondPoint = vector2(-3091, 584),
		ThirdPoint = vector2(-3074, 587),
		FourthPoint = vector2(-3070, 527),
		Center = vector2(-3079, 545), -- Center of zone
		loot = "beach-rare" -- Loot category
	}
}

Config.Loot = { -- Loot categories
    {
        name = 'beach-common', -- Category name
        items = {
            {name = 'bottle', chance = 20, vid = 78, object = `prop_bottle_cognac`, x = 0.0, y = 0.0, z = 1.1, pitch = 20.0, yaw = 0.0, roll = 0.0},
            {name = 'gold', chance = 20, vid = 28, object = `prop_gold_bar`, x = 0.0, y = 0.0, z = 1.0, pitch = 0.0, yaw = 90.0, roll = 0.0},
        }
    },
    {
        name = 'beach-rare',
        items = {
            {name = 'bottle', chance = 1, vid = 78, object = `prop_bottle_cognac`, x = 0.0, y = 0.0, z = 1.1, pitch = 20.0, yaw = 0.0, roll = 0.0},
            {name = 'gold', chance = 99, vid = 28, object = `prop_gold_bar`, x = 0.0, y = 0.0, z = 1.0, pitch = 0.0, yaw = 90.0, roll = 0.0},
        }
    }
}

Config.PersistNotify = function() -- Remove metal detector from your hands hotkey
--your export here
end

Config.PersistNotifyEnd = function() -- End of notification
--your export here
end

Config.HaveDetector = function() -- Have detector in hands when using shovel
--your export here
end

os esc docss

CHECK IT OUT ON OUR TEST SERVER FOR FREE

:books: My other releases:

Code is accessible Yes
Subscription-based No
Lines (approximately) 800
Requirements ESX or QBCore
Support Yes
1 Like