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
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
function MultiArray(iS,bIM,cIM,iMS,iMS2) 	DA = {}; 	for i=0,iS do 		if (bIM) then DA[i] = {}; 			for i2=0,iMS do 				if (cIM) then DA[i][i2] = {}; 					for i3=0,iMS2 do DA[i][i2][i3] = 0; 					end 				else DA[i][i2] = 0; 				end 			end 		else DA[i] = 0; 		end 	end 	return DA; end class_cnt = MultiArray(32,true,true,7,9999) MM_class = MultiArray(32,false,false,0,0) class_cnt[id][MM_class[id]]['frags'] = 0 function MM_serveraction(id,action) 	if action==1 then 		MM_classmenu(id) 	end end function MM_classmenu(id) 	menu(id,"Medieval Mod classes@b,Hobilar|Horse,Bandit|Shield,Bowman|Bow,Ballista|Ballista,Apprentice|Heal,Thief|Stealth,Madman|Rage,Random") end function MM_menu(id,menu,sel) 	if (menu=="Medieval Mod classes") then 		if(sel>=1)and(sel<=7)then 			if sel~=MM_class[id] then 				MM_class[id]=sel 				if(player(id,"health")>0)then 					parse("killplayer "..id) 				end 			elseif sel==MM_class[id] then 				msg2(id,"©255000000[Script]: You already are this class!") 			end 		end 	end end function MM_spawn(id) 	if(MM_class[id]<1)or(MM_class[id]>7)then 		MM_class[id]=math.random(1,7) 	end 	if(MM_class[id]==1)then 		if(class_cnt[id][MM_class[id]]['frags']<10)then 		end 	end end
That's a lot of crappy script yeah; but look at this.
Lua Error #1 has written
[12:43:46] LUA ERROR: sys/lua/medieval mod.lua:103: attempt to compare nil with number
1
if(class_cnt[id][MM_class[id]]['frags']<10)then
Lua Error #2 has written
[12:44:33] LUA ERROR: sys/lua/medieval mod.lua:47: attempt to index field '?' (a nil value)
1
class_cnt[id][MM_class[id]]['frags'] = 0
I won't post more of the code since it's about 800 lines. With ugly tabbing. Should fix that soon..
----
Anyone knows how to make this ['frags'] thing work? Or is the MultiArray function wrong? I honestly don't know.