I found the problem... For some reason it refused to work in my textbutton, but when I deleted it and put in a new text button with the same script it worked perfectly.
This is how I do it
Open = false script.Parent.Mousebutton1Click:connect(function() Gui = script.Parent.Parent.NAMEOFYOURGUI --Just an example, if I wanted the shop to open when clicked if Open == false then Open = true elseif Open == true then open = false end end)
For GUI's you do not use click detectors like you would in a part, instead you would use:
script.Parent.MouseButton1Down:connect(onClicked)
This triggers when the left mouse button is pressed.
Make sure the script is inside the button rather than the click detector when you fix it!
Take a look at this:
http://wiki.roblox.com/index.php/Beginner's_GUI_Tutorial#Buttons