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! :)
GuiObjects have a Visible
property, which is a boolean (true or false). Simply set this to your desired visibility standard.
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."
GUIObjects have a property called Visible
. And there is an event called MouseButton1Down
on buttons, which will fire when you click them.
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