I want to be able to click and then a script checks to see if I have a tool equipped and if I do then it checks to see if the Mouse.Target is, for instance, a model of some stone.

function checkForTargetOre(target)
	if target.Parent.Parent then
		if target.Parent.Parent == "MineableObjects" then
			local oreMined = target.Parent.Parent.Name
			Player.Inventory.oreMined.Value = Player.Inventory.oreMined.Value + 1
		end
	end
end


checkForTargetOre(Mouse.Target)

This does not do anything. It does not give any errors or do anything. Part of the problem may be that when I use humanoid:EquipTool(), the tool is put in my character but the tool doesn't physically appear. I disabled the default roblox backpack so that I could make my own, and I feel like all the problems I just mentioned are being caused by a lack of understanding about how tools work when the default backpack is disabled. Can someone please explain?

Edit:

Never mind I just ended up changing the way it worked entirely because it's acting so weird.