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

Help! Gui shop script not working?

Asked by 10 years ago

I made a surface gui shop using Coins as money but when I click the button it doesn't give me my item or spend the Coins for it. Here's the script.

`repeat wait() Player = game.Players.LocalPlayer Button = script.Parent Item = game.ReplicatedStorage:FindFirstChild("BloxyCola") Cost = 25 Coin = Player.leaderstats.Coins until

Button.MouseButton1Down:connect(function(purchase) if Coin.Value > (Cost - 1) then Coin.Value = Coin.Value - Cost local a = Item:Clone() a.Parent = Player.Backpack local b = Item:Clone() b.Parent = Player.StarterGear end end)`

Answer this question