This is a GUI button script that's supposed to make the frame FRAME visible when clicked and not visible when clicked again, and leaving "Scrollingframe" visible the whole time. It also is supposed to make all of the other frames that aren't FRAME not visible when clicked. The problem now is that everything works like its supposed to except when i click the button it doesn't make FRAME not visible. The way I was doing it before was the FRAME.Visible = (not FRAME.Visible) line but that doesn't seem to be working anymore. How can i tell the script to make FRAME not visible again when i click it a second time?
local BUTTON = script.Parent local ITFRAME = BUTTON.Parent.Parent local FRAME = ITFRAME.SmallHandle local NAME = BUTTON.Text local ITEMNAME = FRAME.Itemname local ScrollingFrame = ITFRAME.ScrollingFrame FRAME.Visible = false function on_button1_down() for I,v in pairs (ITFRAME:GetChildren()) do if v.Name == "ScrollingFrame" --or v.Name == "Hull" -- not sure if I should put this in here or not then v.Visible = true else v.Visible = false FRAME.Visible = (not FRAME.Visible) end end ITEMNAME.Text = NAME end BUTTON.MouseButton1Down:connect(on_button1_down)