example :
Menu > Next > Next > Next ... infinite
Menu < previous < previous < previous ... infinite
tbl={ [1] = "lol 1"; [2] = "lol 2"; [3] = "lol 3"; [4] = "lol 4"; [5] = "lol 1"; [6] = "lol 2"; [7] = "lol 3"; [8] = "lol 4"; [9] = "lol 1"; [10] = "lol 2"; [11] = "lol 3"; [12] = "lol 4"; [13] = "lol 1"; [14] = "lol 2"; [15] = "lol 3"; [16] = "lol 4"; } function menue(id, page) local page = page or 1 local pages = math.ceil(#tbl / 6) if page < 1 then page = pages end if page > pages then page = 1 end local m = 'Select a hat P'.. page for i = 6 * page - 5, 6 * page do if tbl[i] then m = m ..', '.. tbl[i] else m = m ..',' end end if page == pages then m = m ..',,<<- First page' else m = m ..',,Next page -->' end if page == 1 then m = m ..',Last page ->>' else m = m ..',<-- Previvius page' end menu(id, m) end addhook('menu', 'd') function d(id, title, button) if title:sub(1, 14) == 'Select a hat P' then local page = tonumber(title:sub(15)) if button == 8 then menue(id, page + 1) end if button == 9 then menue(id, page - 1) end end end