I have this script that gives me 1 sand if a humanoid touches it. I want to change it so it gives you 1 sand when a tool touches it. Does anybody know how to change it?
script.Parent.Touched:connect(function(part)
if game.Players:findFirstChild(part.Parent.Name) then
local plr = game.Players:findFirstChild(part.Parent.Name)
plr.leaderstats.Ice.Value = plr.leaderstats.Ice.Value + 1
end
end)
local debounce = true
script.Parent.Touched:connect(function(part)
if debounce then
debounce = false
if game.Players:findFirstChild(part.Parent.Name) then
local plr = game.Players:findFirstChild(part.Parent.Name)
plr.leaderstats.Ice.Value = plr.leaderstats.Ice.Value
+1
script.Parent:destroy()
end
end
end)
thanks
