I was trying to make something for Innovation Inc. using surface GUI's. It is a television with surface GUI on it. It came with a button that closed the GUI. The GUI never respawned. I looked at the script and I tried to think of a code but it wouldn't work. Can someone give me a code so I can have it respawn back? Thanks if you do! :)
How would I make a button that hides/shows a GUI?
5 answers
GuiObjects have a Visible property, which is a boolean (true or false). Simply set this to your desired visibility standard.
1 comment
Depending on the script it may also have been deleted, I usually use this when working with tutorials that I dont want poping back up every time the player respawns
If you :Destroy() or :Remove() the GUI then you will need to recreate the GUI again using Instance.new()
Also, as Unclear said, "Please include the code for the script that closed the GUI."
1 comment
What do you mean, recreate the GUI?
GUIObjects have a property called Visible. And there is an event called MouseButton1Down on buttons, which will fire when you click them.
but god said
pretty simple, create a gui and a frame and text button inside, in a script inside the text button write the code below, that will get rid of the text button when it is pressed. You could create another frame with an if statement what makes the other frame visible when the button and other frame is invisible. It will be something like this.
-- function
script.parent.MouseButton1Click:Connect(function() -- does a function
script.parent.parent.visible = false -- makes the textbuttons parent (frame) invisible
end)
-- if statement (this if statement makes it so if the first frame is invisible the new 1 will be visible)
if script.parent.parent.visible = false then
game.StarterGui.ScreenGui.Frame2.visible = false
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Please include the code for the script that closed the GUI.