So I have this code:
game.Players.PlayerAdded:connect(function(player)
script.Parent.MouseButton1Click:connect(function()
gui = player.PlayerGui-- Need to locate playerGui
gui.ScreenGui.Frame1.Visible = true
end
)
end)
This is a normal script inside a SurfaceGui Button.
The problem with this if any player in the game clicks it, the Gui Comes up for everyone in the game. How could I make this so that the Gui comes up only for the person who clicks it? Thanks in advance

3 comments
It works in studio but not in-game!
Local Scripts don't work in workspace, and regular scripts can't access PlayerGui or LocalPlayer.
Oops, sorry! I edited the answer