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

Why is the GUI not closing?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

My goal : I am trying to make a script that opens a window when you click a GUI button the closes that window if it is visible when the button is clicked again. The problem: when i click the button again and again it just keeps printing level 1 complete and stops there it also opens the window., i get no errors in the output to.

a=script.Parent.Parent.Frame
b=script.Parent.Parent.Frame.VoteText
script.Parent.MouseButton1Click:connect(function()
          a.Visible=true
          b.Visible=true
          print("level 1 complete")
end)
function onClicked()
        a.Visible=false
        b.Visible=false
        print("level 3 complete")
    end

    if a.Visible==true and b.Visible==true then
             script.Parent.MouseButton1Click:connect(onClicked)
             print ("level 2 complete")
     else
              print("you failed")
    return end

1
First off, you should consider tabbing the code correctly to make it easier to read. Second, there's a bunch of problems in this. Tkdriverx 514 — 10y
0
yeah its been a while since i scripted on roblox but i dont see the problems and i tabbed it correctly now threatboy101 2 — 10y
0
you say there is alot of errors but you wont point them out? threatboy101 2 — 9y

Answer this question