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

Why isnt the menu working?

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

You forgot to fire the function, with this event:

button.MouseButton1Down:connect(open)

1 comment

0

still doesnt work

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