I want to make this script Disabled = true if it's touched by a tool called Pickaxe
local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Cash")
cash.Value = cash.Value +10
wait(1)
script.Parent:clone().Parent = game.ReplicatedStorage
script.Parent:remove()
wait(5)
game.ReplicatedStorage.Iron1:clone().Parent = game.Workspace
game.ReplicatedStorage.Iron1:remove()
end
end
end
ting = 0
end
script.Parent.Touched:connect(onTouched)
Is there any way you can make it so i must be touched by a certain part or tool then it gives you the money and disappears. EXPLAIN YOUR STEPS! PS. what the script is doing is if its touched by a humanoid give the humanoid 10 Cash remove the brick and clone it and put the clone in replicated storage then wait 5 sec and put it back in workspace
