How To Make A Simple Open/Close Button

Are YOU A New Developer Needing Help On Making A Open/Close Button? Well This Is The Tutorial For You!

Step One: Create A “Screen Gui” In Starter Gui, Click The + Button Then Click Screen Gui.
image
image
Optional Name It Open Close Gui

Step Two: Create A New Text Button And Name It: “Open”, Then Go Into The Properties Then Set The Text To: “Open” And Move The Button Anywhere You Want.
image

Step Three: Repeat Step Two But Name It “Close” And Set The Text To Close, Then Make It Not Visible.

Step Four: Add A Local Script In Your Screen Gui Then Copy This And Paste It Into Your Script:

script.Parent.Open.MouseButton1Click:Connect(function()
   script.Parent.Close.Visible = true
   script.Parent.Open.Visible = false
end)

script.Parent.Close.MouseButton1Click:Connect(function()
   script.Parent.Close.Visible = false
   script.Parent.Open.Visible = true
end)

Step Five: Congrats! You’ve Now Made A Open & Close Gui On Roblox! Share With Your Friends.

17 Likes

Nice tutorial. You should surround the code with three backticks like this: (Remove the brackets)
(```)

1 Like

yeah i was trying to but it didnt work i guess i was doing it wrong. lol

Do that
image

1 Like

Is there a reason why you capitalized every word?

4 Likes

Cool tutorial but this is far more efficient.

function openorclose()
script.Parent.Open.Visible = not script.Parent.Open.Visible
script.Parent.Close.Visible = not script.Parent.Close.Visible
end
script.Parent.Open.MouseButton1Click:Connect(openorclose)
script.Parent.Close.MouseButton1Click:Connect(openorclose)

Still, good tutorial.

2 Likes

It seems some people prefer to capitalize the first letter of each word. I’ve seen it before.

i literally dont know why i do it, i just like it lol

2 Likes

i just like doing it idk why, lol.

2 Likes

Sorry to be a stickler and necroposter, but it isn’t correct grammar you know?

womp wo-

I know correct grammar now lol
and I’m much smarter, this was probably the most stupidest posts I’ve ever made, this is very simple

1 Like

lol. Glad to hear it. I’m sure someone benefited from this post though!