Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can Someone Help Me Make a Open And Close GUI?

Asked by 8 years ago
Edited 8 years ago

**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

Log in to vote
0
Answered by
dirk2999 103
8 years ago
Edited 8 years ago

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

01shop = INSERT GUI DIRECTORY
02button = INSERT BUTTON DIRECTORY
03 
04open = false
05 
06button.MouseButton1Down:connect(function()
07if open == false then
08shop.Visible = true
09button.Text = "Close"
10open = true
11else
12shop.Visible = false
13button.Text = "Open"
14open = false
15end
16end)
0
I would add a wait(3) before the open = false so they do not spam click, that way the debounce works. yougottols1 420 — 8y
0
Tabbing + locals are a neat way to make your script readable. Async_io 908 — 8y
1
locals doesn't really make it more readable. Also, you could shorten this a ton :3 User#11440 120 — 8y
Ad

Answer this question