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

How to solve a gui button script for buying stuff ?

Asked by 3 years 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 394 — 3y
0
very much appreciated for your response. hitmna123 21 — 3y

Answer this question