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

Why isnt the menu working?

Asked by 8 years ago

Im trying to get the stats menu to open when I click a text button and then close when I click it again it works when I have the open part of the script but once I add in the other part to close it it doesnt work for any of them,

screenGUI = script.Parent.Parent

stats = screenGUI.statholder --the Frame for it 

button = script.Parent --then textbutton to open

opem = 1

function open()
    if opem == 1 then
        button.Visible = true
        opem = 0
    end
        else button.Visible =false
            opem = 1
end

button.MouseButton1Down:connect(open)

yes i am aware opem is not open

heres the output: 17:58:38.174 - Auto-Saving... 17:58:38.994 - StarterGui:RegisterSetCore is not yet enabled 17:58:39.663 - Players.Player1.PlayerGui.ScreenGui.StatusButton.LocalScript:14: 'end' expected (to close 'function' at line 9) near 'else' 17:58:39.716 - StarterGui:RegisterSetCore is not yet enabled 17:58:39.717 - StarterGui:RegisterGetCore is not yet enabled 17:58:39.717 - StarterGui:RegisterSetCore is not yet enabled 17:58:39.718 - StarterGui:RegisterGetCore is not yet enabled

1 answer

Log in to vote
0
Answered by 8 years ago

You forgot to fire the function, with this event:

button.MouseButton1Down:connect(open)
0
still doesnt work AngelOfMadness 0 — 8y
Ad

Answer this question