1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
menus = {
	menu1 = {
		title = "LMAOS",
		buts = {
			[1] = "LOLZ|ROFL",
			[2] = EXAMPLE,
			[3] = EXAMPLE,
			[4] = EXAMPLE,
			[5] = EXAMPLE,
			[6] = EXAMPLE,
			[7] = EXAMPLE,
			[8] = EXAMPLE,
			[9] = EXAMPLE,
		},
		tilepos = {0,0},
		funcs = { -- functions to be parsed on choosing a button
			[1] = function(id) -- function for button 1
				-- DO STUFF
			end
			-- and so on
		}
	}
}
--SCRIPT--
function menu_box(id,m)
menu(id,menus[m].title..","..menus[m].but[1]..","..menus[m].but[2]..","..menus[m].but[3]..","..menus[m].but[4]..","..menus[m].but[5]..","..menus[m].but[6]..","..menus[m].but[7]..","..menus[m].but[8]..","..menus[m].but[9])
end
addhook("menu","menu_press")
function menu_press(id,menu,sel)
	for _,m in pairs(menus) do
		if (menu==m.title) then
			m.funcs[sel](id)
		end
	end
end
ddhook("use","menu_use")
function menu_use(id,_,_,x,y)
	for k,m in pairs(menus) do
		if player(id,"tilex") == m.tilepos[1] and player(id,"tiley") == m.tilepos[2] then
			menu_box(id,k)
		end
	end
end