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 7 years ago
Edited 7 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
7 years ago
Edited 7 years ago

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)
0
I would add a wait(3) before the open = false so they do not spam click, that way the debounce works. yougottols1 420 — 7y
0
Tabbing + locals are a neat way to make your script readable. Async_io 908 — 7y
1
locals doesn't really make it more readable. Also, you could shorten this a ton :3 User#11440 120 — 7y
Ad

Answer this question