Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This Opens and Closes then doesn't open again (these two scripts) why?

Script 1

-- Variables
GUI = script.Parent.Parent
Frame1 = GUI.AFrame
Button = script.Parent.Parent.OpenClose
Button2 = GUI.AFrame.X
GUIOpen = false
Button3 = GUI.AFrame.Next
Page1Open = false
Frame2 = GUI.BFrame

----------------------------
Button2.MouseButton1Down:connect(function()
	Frame1.Visible = false
	GUIOpen = false
	
	if GUIOpen == false then
		script.Parent.Parent.OpenClose.Visible = true
	elseif GUIOpen == true then
		GUIOpen = false
	end
end)

Script 2


-- Variables
GUI = script.Parent.Parent
Frame1 = GUI.AFrame
Button = script.Parent.Parent.OpenClose
Button2 = GUI.AFrame.X
GUIOpen = false
Button3 = GUI.AFrame.Next
Page1Open = false
Frame2 = GUI.BFrame


---------------------------

Button.MouseButton1Down:connect(function()
	wait()
	if GUIOpen == false then
		Frame1.Visible = true
		Button.Visible = false
		GUIOpen = true
		
	end
end)

1 answer

✓ Accepted answer

You never set GUIOpen to true.

Since you never set it to true, it will always be false. Since it will always be false, the 'closing' part of the if statement will never run.

Just set it to true.


if GUIOpen == false then
	script.Parent.Parent.OpenClose.Visible = true
	GUIOpen = true

This discussion is preserved as it was. New answers, comments, and votes are closed.