Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to solve a gui button script for buying stuff ?

Asked by 15 days ago

local button = script.Parent

button.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer local stats = player.leaderstats.Gold.Value print("processing") if stats >= 1000 then local coil = game.ServerStorage.SpeedCoil coil.Parent = game.StarterPack stats = stats-1000

end

end)

it keeps breaking at local coil = ......

Can you help me explain the problem why it keeps breaking. and also this is a gui shop.

0
There are a few problems, but ServerStorage cannot be accessed from the client(a local script). If you need access to SpeedCoil, you'll either need to move its location, or have the Server send SpeedCoil to the client. SteelMettle1 268 — 15d
0
very much appreciated for your response. hitmna123 19 — 15d

Answer this question