Hello, whenever I click my GUI to show the menu it works by showing the main menu. When I click the GUI again however, everything vanishes and I am unable to click the GUI again. I am unaware of what is causing such problem, as I am very new to scripting. In fact, this isn't my script. Please be aware.
Thanks, Azure.
01 | local open = false |
02 | script.Parent.MouseButton 1 Click:Connect( function () |
03 | if not open then |
04 | open = true |
05 | script.Parent.Parent.Parent.Frame.Visible = true |
06 | script.Parent.Parent.Parent.settings.Visible = false |
07 | script.Parent.Parent.Parent.shop.Visible = false |
08 | script.Parent.Parent.Parent.help = false |
09 | else |
10 | script.Parent.Parent.Parent.Frame.Visible = false |
11 | script.Parent.Parent.Parent.settings.Visible = false |
12 | script.Parent.Parent.Parent.shop.Visible = false |
13 | script.Parent.Parent.Parent.help = false |
14 | open = false |
15 | end |
16 | end ) |
this should work:
01 | local open = false |
02 |
03 | script.Parent.MouseButton 1 Click:Connect( function () -- fire event when plr clicks |
04 | if not open then -- is the value false? |
05 | open = true -- set value to true |
06 | script.Parent.Parent.Parent.Frame.Visible = true -- set visible to true |
07 | script.Parent.Parent.Parent.settings.Visible = true |
08 | script.Parent.Parent.Parent.shop.Visible = true |
09 | script.Parent.Parent.Parent.help.Visible = true |
10 | else |
11 | open = false -- set value to false |
12 | script.Parent.Parent.Parent.Frame.Visible = false -- set visible to false |
13 | script.Parent.Parent.Parent.settings.Visible = false |
14 | script.Parent.Parent.Parent.shop.Visible = false |
15 | script.Parent.Parent.Parent.help.Visible = false |
16 | end |
17 | end ) |