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

Can Someone Help Me Make a Open And Close GUI?

**What i Mean Is Like I Make A Frame Then I Add Button One That Says Open And One That Says Close But When You Press The Close It Closes The Gui And Also Displays The Open Button Then When You Press That It Displays The Gui And Close Button

Can Someone Help Me?**

1 answer

Well the better way to do it is one button opens and closes it,

shop = INSERT GUI DIRECTORY
button = INSERT BUTTON DIRECTORY

open = false

button.MouseButton1Down:connect(function()
if open == false then
shop.Visible = true
button.Text = "Close"
open = true
else
shop.Visible = false
button.Text = "Open"
open = false
end
end)

3 comments

0

I would add a wait(3) before the open = false so they do not spam click, that way the debounce works.

0

Tabbing + locals are a neat way to make your script readable.

1

locals doesn't really make it more readable. Also, you could shorten this a ton :3

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