This script doesn't work but nothing shows in the output so i'm completely lost right now. Can somebody help?
Script:
db = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
if db == false then
db = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local wood = game.ReplicatedStorage.Tools.Wood
if wood.Parent == player.Backpack then
wood:Destroy()
player.leaderstats.Passes.Value = player.leaderstats.Passes.Value + 1
script.Parent.BrickColor = BrickColor.new("Really red")
wait(5)
script.Parent.BrickColor = BrickColor.new("Medium stone grey")
db = false
end
end
end
end)

6 comments
try putting print on some of the lines to check if the script is running
I did try, doesn't work. It's like the script is disabled but it isn't disabled. :(
Do you have the object "Wood"? Also, when the tool is equipped, it goes into your player's character. It might not be detecting the humanoid and it might be detecting something else. Before line 4, put print("hit")
Also, what is the script supposed to do?
Script's supposed to get rid of your "wood" and give you 1 "pass" so like a sell system. I'm new to scripting so idk much
when i touch the part it print "hit" but does nothing else