Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How come the player wont get the tool?

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)

1 comment

0

Make 'Clone()' capital, like that.

1 answer

✓ Accepted answer
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()"

This discussion is preserved as it was. New answers, comments, and votes are closed.