I have a Gui and when the player clicks on the button it disappears. The only problem is when they respawn it pops up again. I want this to not pop up again once they have respawned.
wait(1) script.Parent.Main.Close.MouseButton1Down:connect(function() script.Parent:remove() end)
Thank you.
Put the gui in replicated storage. Put this inside a script(Not local)
game.Players.PlayerAdded:connect(function(player) g = game.ReplicatedStorage.GUINAMEHERE:Clone() g.Parent = player.PlayerGui end)
You could always create a boolean value for each player when they spawn, and once the GUI closes, the boolean value changes to true or false (your pick). You could then modify your script to check if that value is true or false, and only activate on one of them.
EDIT:
To make this seem a bit more possible, I'd suggest placing a boolean value into the player when they join. Assuming your script above is a local script, you can easily locate the boolean inside of the player through the use of LocalPlayer
.