I'm making a incinerator where if you hold a a specific tool (BOX) it will destroy it but for some reason this script doesn't mark anything , the output doesn't say anything please help ?
local box = game.Workspace.BOX local thing = script.Parent local player = game.Players.LocalPlayer thing.Touched:Connect(function() if player.Backpack:FindFirstChild("BOX") then box:Destroy() print("Removed the players Item") else if player.Backpack.Box ==false then player.Backpack.BOX = false end end end)
PS this is a local script BTW
Use a serverscript instead of a localscript. The issue here is you trying to define player using something that would only work inside a player. Put this script inside of a part.
local thing = script.Parent thing.Touched:Connect(function(Touch) local Player = Touch.Parent print(Player) if Player:FindFirstChild("Box") ~= nil then Player:FindFirstChild("Box"):Destroy() print("Removed the players Item") end end)