I know the problem but i dont know how to fix
I want change proj_item[id] Based on function proj_drop (id, item)
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
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
function array(a)
	local array = {}
	for i = 1, a do
		array[i]=0
	end
	return array
end
proj_1 = array(32)
proj_2 = array(32)
function proj_drop(id,item)
	proj_item[id]=proj_item[id]+1
	parse("equip "..id.." "..item)
end
addhook("say","say")
function say(id,say)
	if (say=="hi") then
		proj_drop(id,1)
	end
end
addhook("always","aks")
function aks()
	for id = 1, 32 do
		parse('hudtxt2 '..id..' 1 "'..proj_1[id]..'" 10 140')
	end
end
edited 2×, last 17.01.21 07:50:38 pm
LUA ERROR: sys/lua/test2.lua:12: attempt to index
1 
Offline
ohaz