Im new to lua and I need help. Im trying to make a script where if I click something it will open the gui, if its already open then it will close.
How can I get this to work?
game = Game.StarterGui.ScreenGui
game2 = Game.StarterGui.ScreenGui2
open = false
function onButtonClicked()
if open == false then
game2.Frame.Visible = true
else
game2.Frame.Visible = false
end
end
script.Parent.MouseButton1Down:connect(onButtonClicked)
