GUI MouseButton1Click menu Visible/not Visible

Hello nice people. I make a little game and made a little menu. Wenn someone clicks on the “icon” (I add in the future a icon) then a little menu appear. Is there a option if the player clicks a second time on it. The Menu dissapear?

I uploadet a little video on youtube, with my little game I made.

Sorry for my english. I am from Austria :wink:
nice regards
sebastian

local var = false
local button = ...


button.MouseButton1Click:Connect(function()
	if var then
		var = false
		-- hide gui
	else
		var = true
		-- show gui
	end
end)
1 Like

thank you for fast reply I have made it but doesnt work. Is something false?

thats my script

You can use ‘not’ to make it the opposite as it is right now.

--//Variables\\--
local IconButton = script.Parent.IconButton
local Options = script.Parent.Options

--//Scripts\\--
IconButton.MouseButton1Click:Connect(function()
       Options.Visible = not Options.Visible
end)
2 Likes

thank you very much that works :smiley:

1 Like

Are you from germany because your name geiler haha ?

2 Likes

Yes, hahaha.

30chars