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)

7 comments
where is the local script located
Inside the surfacegui
where is the surfacegui located XD
inside a part in the workspace
dude, localscripts won't work in workspace
try placing the localscript in playerscripts, and replacing script.Parent with where the surfacegui is
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