Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
7 years ago

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
Ad

Answer this question