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

[Solved] My surfacegui shop isn't working, and there are no output errors. Help?

Asked by 5 years ago
Edited 5 years ago

I have tried to make a surfacegui shop but when you click the buy button nothing happens. My script is a LocalScript, but even in a normal script using PlayerAdded it doesn't work.

script.Parent.TextButton.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
local points = plr.leaderstats.Points
if points.Value > 24 then
print("Purchased!")
game.ReplicatedStorage.RemoteEvent:FireServer()
else print("Not enough")
end
end)
0
where is the local script located User#5423 17 — 5y
0
Inside the surfacegui Boi52893642864912 69 — 5y
0
where is the surfacegui located XD User#5423 17 — 5y
0
inside a part in the workspace Boi52893642864912 69 — 5y
View all comments (3 more)
0
dude, localscripts won't work in workspace AAzterr 27 — 5y
0
try placing the localscript in playerscripts, and replacing script.Parent with where the surfacegui is AAzterr 27 — 5y
0
I saw AaditSayam's comment and figured out what was wrong. I put the localscript inside the StarterGui and changed it up a bit and it works now Boi52893642864912 69 — 5y

Answer this question