/md-metaldetecting

A metal detecting script built for QB-Core framework! It will check if you are on sand or grass and if you are will start scanning. Then a minigame will pop up and give items

Primary LanguageLua

md-metaldetecting


Dependencies :

How to install like a boss

Step 1:

  • Pet a cat, Super important.

Step 2:

  • Add the following to qb-core/server/player.lua inside your existing playerdata
	PlayerData.metadata['metaldetecting'] = PlayerData.metadata['metaldetecting'] or 0

Step 3: Add items to your inventory you use.

qb-core/shared/items.lua

["1792coin"] 				    = {["name"] = "1792coin", 			    	["label"] = "1792 Coin", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "1792coin.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Even older"},
["1797coin"] 				    = {["name"] = "1797coin", 			    	["label"] = "1797 Coin", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "1797coin.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Dat's old"},
["bobbypin"] 				    = {["name"] = "bobbypin", 			    	["label"] = "Bobby Pin", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "bobbypin.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Put your hair up"},
["bottlecap"] 				    = {["name"] = "bottlecap", 			    	["label"] = "Bottle Cap", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "bottlecap.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Stepped on a pop top"},
["clump"] 				    	= {["name"] = "clump", 			    		["label"] = "Clump", 		     	 ['weight'] = 100, 		["type"] = "item", 		["image"] = "clump.png", 			    	["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Not a turd"},
["corno"] 				     	= {["name"] = "corno", 			    		["label"] = "Corno", 		     	 ['weight'] = 100, 		["type"] = "item", 		["image"] = "corno.png", 			    	["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = ""},
["diamondring"] 				= {["name"] = "diamondring", 			    ["label"] = "Diamond Ring", 		 ['weight'] = 100, 		["type"] = "item", 		["image"] = "diamondring.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Pretty sure some poor kid made this"},
["goldbracelet"] 				= {["name"] = "goldbracelet", 			    ["label"] = "Gold Bracelet", 		 ['weight'] = 100, 		["type"] = "item", 		["image"] = "goldbracelet.png", 			["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Is this bracelet real gold?"},
["golddiamondring"] 			= {["name"] = "golddiamondring", 			["label"] = "Gold Diamond Ring", 	 ['weight'] = 100, 		["type"] = "item", 		["image"] = "golddiamondring.png", 			["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "It's a gold ring with a diamond?"},
["goldring"] 				    = {["name"] = "goldring", 			    	["label"] = "Golden Ring", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "goldring.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "My precious"},
["rubyring"] 				    = {["name"] = "rubyring", 			    	["label"] = "Ruby Ring", 		     ['weight'] = 100, 		["type"] = "item", 		["image"] = "rubyring.png", 			    ["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "It is a ruby, not a rubix"},
["toycar"] 				     	= {["name"] = "toycar", 			    	["label"] = "Toy Car", 		     	 ['weight'] = 100, 		["type"] = "item", 		["image"] = "toycar.png", 			    	["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Don't put it in odd places"},
["metaldetector"] 				= {["name"] = "metaldetector", 			    ["label"] = "Metal Detector", 		 ['weight'] = 2500, 		["type"] = "item", 		["image"] = "metaldetector.png", 		["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,	   ["combinable"] = nil,                     ["description"] = "Maybe it can find things"},

ox_inventory/data/items.lua

	["golddiamondring"] = {
		label = "Gold Diamond Ring",
		weight = 100,
		stack = true,
		close = true,
		description = "It's a gold ring with a diamond?",
		client = {
			image = "golddiamondring.png",
		}
	},

	["goldbracelet"] = {
		label = "Gold Bracelet",
		weight = 100,
		stack = true,
		close = true,
		description = "Is this bracelet real gold?",
		client = {
			image = "goldbracelet.png",
		}
	},

	["goldring"] = {
		label = "Golden Ring",
		weight = 100,
		stack = true,
		close = true,
		description = "My precious",
		client = {
			image = "goldring.png",
		}
	},

	["rubyring"] = {
		label = "Ruby Ring",
		weight = 100,
		stack = true,
		close = true,
		description = "It is a ruby, not a rubix",
		client = {
			image = "rubyring.png",
		}
	},

	["bottlecap"] = {
		label = "Bottle Cap",
		weight = 100,
		stack = true,
		close = true,
		description = "Stepped on a pop top",
		client = {
			image = "bottlecap.png",
		}
	},

	["corno"] = {
		label = "Corno",
		weight = 100,
		stack = true,
		close = true,
		description = "",
		client = {
			image = "corno.png",
		}
	},

	["toycar"] = {
		label = "Toy Car",
		weight = 100,
		stack = true,
		close = true,
		description = "Don't put it in odd places",
		client = {
			image = "toycar.png",
		}
	},

	["metaldetector"] = {
		label = "Metal Detector",
		weight = 2500,
		stack = true,
		close = true,
		description = "Maybe it can find things",
		client = {
			image = "metaldetector.png",
		}
	},

	["1797coin"] = {
		label = "1797 Coin",
		weight = 100,
		stack = true,
		close = true,
		description = "Dat's old",
		client = {
			image = "1797coin.png",
		}
	},

	["bobbypin"] = {
		label = "Bobby Pin",
		weight = 100,
		stack = true,
		close = true,
		description = "Put your hair up",
		client = {
			image = "bobbypin.png",
		}
	},

	["1792coin"] = {
		label = "1792 Coin",
		weight = 100,
		stack = true,
		close = true,
		description = "Even older",
		client = {
			image = "1792coin.png",
		}
	},

	["diamondring"] = {
		label = "Diamond Ring",
		weight = 100,
		stack = true,
		close = true,
		description = "Pretty sure some poor kid made this",
		client = {
			image = "diamondring.png",
		}
	},

	["clump"] = {
		label = "Clump",
		weight = 100,
		stack = true,
		close = true,
		description = "Not a turd",
		client = {
			image = "clump.png",
		}
	},

Step 4:

  • Add items images to qb-inventory/html/images or ox_inventory/web/images

Step 5:

Step 6:

  • take the bostra_metaldetector folder and place it in your resources folder