I have a GUI which I want to open using a button in a different GUI. When said GUI is open (the one which opens the other one) and I press the button nothing happens. Otherwise, the GUI opens even if my boolvalue, Open is set to false. I'm using all LocalScripts by the way.
--Script one
local open = game.StarterGui.ScreenGui.KartChoiceGUI.Open
local gui = script.Parent
if open == true then
gui.Visible = true
else
gui.Visible = false
end
--Script two
local button = script.Parent
local gui = script.Parent.Parent.Parent.KartBuyGUI
local lit = button.MouseButton1Click
local open = script.Parent.Parent.Open
if lit then
open = true
end
if open == true then
gui.Visible = true
end
if gui.Visible == true then
if not lit then
if not open then
gui.Visible = false
end
end
end
The code in these if statements are run, regardless of the fact if they're true or not.

1 comment
works now, thanks