I didn't add the additional data table argument yet which will allow an easy way to edit a button without digging through tons of code, so you can reuse one func for many buttons
Button name and Button description can be both string or a function returning a string (See last button "Current money:")
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
menus = {
	[1] = {
		title = "Weapon Shop@b",
		items = {
			{"AK-47","$2500",function(id)
				if player(id,"money")>=2500 then
					parse("equip "..id.." 30")
					parse("setmoney "..id.." "..player(id,"money")-2500)
				else
					msg2(id,"You don't have enough money!")
				end
			end},
			{"AWP","$3000",function(id)
				if player(id,"money")>=3000 then
					parse("equip "..id.." 35")
					parse("setmoney "..id.." "..player(id,"money")-3000)
				else
					msg2(id,"You don't have enough money!")
				end
			end},
			{"M4A1","$2600",function(id)
				if player(id,"money")>=2600 then
					parse("equip "..id.." 32")
					parse("setmoney "..id.." "..player(id,"money")-2600)
				else
					msg2(id,"You don't have enough money!")
				end
			end},
			{"Five-Seven","$500",function(id)
				if player(id,"money")>=500 then
					parse("equip "..id.." 6")
					parse("setmoney "..id.." "..player(id,"money")-500)
				else
					msg2(id,"You don't have enough money!")
				end
			end},
			{"Message: Red","$10",function(id)
				parse("setmoney "..id.." "..player(id,"money")-10)
				msg("©255000000Red Message")
			end},
			{"Message: Green","$10",function(id)
				parse("setmoney "..id.." "..player(id,"money")-10)
				msg("©000255000Green Message")
			end},
			{"Message: Blue","$10",function(id)
				parse("setmoney "..id.." "..player(id,"money")-10)
				msg("©000000255Blue Message")
			end},
			{"Message: White","$10",function(id)
				parse("setmoney "..id.." "..player(id,"money")-10)
				msg("©255255255White Message")
			end},
			{"Message: Black","$10",function(id)
				parse("setmoney "..id.." "..player(id,"money")-10)
				msg("©000000000Black Message")
			end},
			{function (id)
				return "Current money:" end,
			function (id)
				return player(id, "money")
			end,
			function (id)
				msg("Current money: " .. player(id, "money"))
			end}
		},
	}
}
menuPageStrings = {{}}
lastOpenedMenu = {}
function unimenu(id, construct, targetMenu, page)
	if not menuPageStrings[id] then menuPageStrings[id] = {} end
	
	if targetMenu ~= "current" then
		if construct then
			
			local workMenu, workMenuItems	-- the menu we're will work with			
			if type(targetMenu) == "table" then
				workMenu, workMenuItems = targetMenu, targetMenu.items	
			else
				workMenu, workMenuItems = menus[ targetMenu ], menus[ targetMenu ].items
			end
			
			lastOpenedMenu[id] = targetMenu
			local paget = math.ceil(#workMenuItems/7)
			local menuMode = string.match(workMenu.title, "(@[ib])$") or ""	-- if mode string not found then don't set it
			for i = 1, paget do
			
				menuPageStrings[id][i] = string.gsub(workMenu.title, "(@[ib])$", "") .." - Page ".. i .. menuMode .. "," -- replace the menuMode suffix in title with ""
				
				for ii = 1, 7 do
					local sid = ii+(7*(i-1))
					local menuButtonName, menuButtonDesc
					if workMenuItems[sid] then
						if type(workMenuItems[sid][1]) == "string" then	-- if it's a string
							menuButtonName = workMenuItems[sid][1]	-- use it
						else
							menuButtonName = workMenuItems[sid][1](id)	-- if not, it should return the Button name
						end
						if type(workMenuItems[sid][2]) == "string" then
							menuButtonDesc = workMenuItems[sid][2]
						else
							menuButtonDesc = workMenuItems[sid][2](id)
						end
						menuPageStrings[id][i] = menuPageStrings[id][i] .. menuButtonName .."|".. menuButtonDesc ..","
					else
						menuPageStrings[id][i] = menuPageStrings[id][i] ..","
					end
				end
				
				if i < paget then 	menuPageStrings[id][i] = menuPageStrings[id][i] .."Next" end
				if i > 1 then 		menuPageStrings[id][i] = menuPageStrings[id][i] ..",Back" end
			end
		end
	end
	
	menu(id, menuPageStrings[id][page])
end
addhook("menu","unimenuhook")
function unimenuhook(id,menu,sel)
	local p = tonumber(menu:sub(-1))
	
	if sel < 8 and sel > 0 then
		local s = sel + (7 * (p - 1))
		if type(lastOpenedMenu[id]) == "table" then
			lastOpenedMenu[id].items[s][3](id)
		else
			menus[ lastOpenedMenu[id] ].items[s][3](id)
		end
	else
		if sel == 8 then
			unimenu(id, true, "current", p+1)
		elseif sel == 9 then
			unimenu(id, true, "current", p-1)
		end
	end
end