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

Not valid member of part? [FIXED]

Asked by
xAtom_ik 574 Moderation Voter
9 years ago

It has been fixed

I have figured out the error myself. Thank you for those who attempted to help me

The Error:

The part was being removed before the funds were added, so it wasn't there anyway.

Edited Script:

script.Parent.Touched:connect(function(hit)
    if hit.Name == "DropperFund" then
        if hit:FindFirstChild("Code") ~= nil then
            if hit.Code.Value == string.reverse("321dnuFrepporD") then -- DropperFund123                
                game.Players[game.Workspace.Tycoon1Taken.Owner.Value].leaderstats.Money.Value = game.Players[game.Workspace.Tycoon1Taken.Owner.Value].leaderstats.Money.Value + hit["Money"].Value
                hit:Destroy()
            end
        end
    end
end)

Answer this question