Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with gui script?

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.

2 answers

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)

3 comments

0

Doesn't work.

0

Right ill come up with something...

0

Did you replace the GUINAMEHERE with your gui's actual name?

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.