I have been having trouble with changing this script
for _,v in pairs(script.Parent:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:Connect(function(hit)
if not script.Parent:FindFirstChild(tonumber(v.Name)-1) then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr and plr:FindFirstChild("leaderstats") then
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 1
end
v:Destroy()
end
end)
end
end
so that instead of a humanoid touching it and getting a coin I want a tool to touch it and get the coin.thanks
