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

checking for the shovel tool?

Asked by 6 years ago

I made this script that cechs that I have the Shovel equipted the it gives me 1 sand. I can't get it to work.

script.Parent.Touched:connect(function(part)
    if part.Parent:IsA("Tool") and game.Players:FindFirstChild(part.Parent.Parent.Name) then
    if game.StarterPack.Shovel = true then
        local plr = game.Players:findFirstChild(part.Parent.Parent.Name)
        wait(1)
        plr.leaderstats.Sand.Value = plr.leaderstats.Sand.Value + 1000
        script.Parent:Destroy()
    end
end)

Answer this question