Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change humanoid to tool?

Asked by 6 years ago

I've tryed to change 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

from when a humanoid touched it you get one coin to when a tool touched it. I haven't seem to find a way for this to work. Can anybody help. Thanks

0
What is the problem? Did you get any errors? bartekrabit 38 — 6y
0
I don't know how to do it. I messed with it but nothing happened ootheboss 32 — 6y

Answer this question