1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
isEnabled = true
function menu1(id)
	menu(id,"Blablabla, Setting 1| "..isEnabled..",hi") -- your menu what so ever (doesnt have to be a function but i recommend it
end
addhook("menu","menuh")
function menuh(id,t,b)
	if (t=="Blablabla") then
		if (b==1) then -- user want to change setting 1
			if (isEnabled) then -- toggle variable of that setting
				isEnabled = false
				-- todo: what to do if deactivated
				parse("kill "..id)
			else
				 isEnabled = true
				-- todo: what to do if activated
			end
			menu1(id) -- REOPEN menu, thats the effect of the "non closing menu"
		elseif (b==2) then
			msg("hi :3")
		end
	end
end