How do I make a GUI toggle button?

You can use a variable for this:

local isOpen = false 

--click event
if not isOpen then
    --not toggled, so toggle the UI
else
     --toggled, so untoggle the UI
end

isOpen = not isOpen --flip the value of the bool
4 Likes