@edit
What i have to change in this piece of 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function lootresp() -- func join 	lootarr = {} 	local i = 1 	repeat 	local xpix = tonumber(map("xsize")) *32 	local ypix = tonumber(map("ysize")) *32 	local randomx = math.floor(math.random(1,xpix/32))*32-16 	local randomy = math.floor(math.random(1,ypix/32))*32-16 	lootarr[i] = {x = randomx, y = randomy} 	image("gfx/movecs2d/dayz/loot.PNG",randomx,randomy,1) 	print(i) 	i = i + 1 	until (i > 35) end function lootop(id,x,event,data,x,y) -- func use 	local i = 1 	repeat 	if (x == lootarr[i][x]) then 		if (y == lootarr[i][y]) then 			menu(id, "test,test2,lol") 		end 	end 	until (i == #lotarr) -- error is here end
Error:
lua:106: attempt to index global 'lotarr' (a nil value)
lua:106 is at until (i == #lotarr)
edited 2×, last 28.01.15 02:30:38 pm