Im going crazy because I know the error is sooo stupid but I cant fix it.
Here is the code
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
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
hattable = { {name = "Angel", path = "gfx/hats tiky/angel.png"}, {name = "Devil", path = "gfx/hats tiky/devil.png"}, {name = "Cowboy", path = "gfx/hats tiky/cowboy.png"}, {name = "Graduate", path = "gfx/hats tiky/graduate.png"}, {name = "Scarlet Beret", path = "gfx/hats tiky/scarlet_beret.png"}, {name = "Pirate", path = "gfx/hats tiky/pirate.png"}, {name = "Pumpkin", path = "gfx/hats tiky/pumpkin.png"}, {name = "Santa", path = "gfx/hats tiky/santa.png"}, -- Guess work {name = "Snowman", path = "gfx/hats tiky/snowman.png"}, {name = "Black", path = "gfx/hats tiky/black.png"}, {name = "Phoenix", path = "gfx/hats tiky/phoenix.png"}, {name = "Skull", path = "gfx/hats tiky/skull.png"}, {name = "Tyrans", path = "gfx/hats tiky/tyrans.png"}, } currenthat = {} hatimg = {} addhook("serveraction","hat_serveraction") function hat_serveraction(id,act) callmenu(id,2) end function callmenu(id,page) local pages = math.ceil(#hattable/7) local output = "Hat Menu Page "..page local p = pages * 7 for a = p-6, p do if hattable[a] then if (hattable[a].name and hattable[a].path) then if a ~= currenthat[id] then output = output..","..hattable[a].name else output = output..",("..hattable[a].name end else output = output.."," end else output = output.."," end end if page == 1 then if currenthat[id] ~= 0 then output = output..",No hat" else output = output..",(No hat" end else output = output..",Back Page |Page "..page-1 end if page == pages then if currenthat[id] ~= 0 then output = output..",No hat" else output = output..",(No hat" end else output = output..",Back Page |Page "..page+1 end menu(id,output) end addhook("menu","hat_menu") function hat_menu(id,title,button) if string.sub(title,1,14) == "Hat Menu Page " then local page = tonumber(string.sub(title,15)) local pages = math.ceil(#hattable/7) if button >= 1 and button <= 7 then local pr7 = (page - 1) * 7 local rsel = pr7 + button if currenthat[id] ~= rsel then if hatimg[id] then freeimage(hatimg[id]) end currenthat[id] = rsel hatimg[id] = image(hattable[rsel].path,1,1,200+id) end elseif button == 8 then if page == 1 then if hatimg[id] then freeimage(hatimg[id]) end hatimg[id] = nil currenthat[id] = 0 else callmenu(id,page-1) end elseif button == 9 then if page == pages then if hatimg[id] then freeimage(hatimg[id]) end hatimg[id] = nil currenthat[id] = 0 else callmenu(id,page+1) end end end end
If someone can help i would be so grateful