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

How come the player wont get the tool?

Asked by 10 years ago

For some reason, when the player buys something from the gui shop, he is supposed to get the tool but in this case he doesn't (and yes, i put the tool in the lighting) can anyone tell me why this wont work?

Cash = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("leaderstats"):WaitForChild("Credits")

function onClick()
    if Cash.Value >= 50 then
        Cash.Value = Cash.Value - 50
            local RockLaunch = game.Lighting.EconomyClassTicket:clone()
            RockLaunch.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear
            local RockLaunch = game.Lighting.EconomyClassTicket:clone()
            RockLaunch.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack
            RockLaunch.Handle.Anchored = false
    end
end

script.Parent.MouseButton1Click:connect(onClick)

0
Make 'Clone()' capital, like that. Perci1 4988 — 10y

1 answer

Log in to vote
-2
Answered by
Hybric 271 Moderation Voter
10 years ago
Cash = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("leaderstats"):WaitForChild("Credits")

function onClick()
    if Cash.Value >= 50 then
        Cash.Value = Cash.Value - 50
            local RockLaunch = game.Lighting.EconomyClassTicket:Clone()
            RockLaunch.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack
            RockLaunch.Handle.Anchored = false
            local RockLaunch = game.Lighting.EconomyClassTicket:Clone()
            RockLaunch.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear
    RockLaunch.Handle.Anchored = false
    end
end

script.Parent.MouseButton1Click:connect(onClick)


"clone() is supposed to be "Clone()"

Ad

Answer this question