can some1 tell me why this code produces 1 error
points = 0
checked = {}
enemy = 1
for a = 2, 9 do
checked[a] = 0
end
function deathpoints_main(e)
for a = 2 , 9 do
if enemy > 8 then
enemy = 2
else
enemy = enemy + 1
end
if checked[a] == 0 then
if g_Entity[enemy]['health'] < 1 then
points = points + 10
checked[a] = 1
end
end
end
Prompt("points = " .. points)
end
error running fuction: scriptbank\deathpoints.lua:18: attempt to index field '?' (a nil value)
and after closing this error it runs perfectly fine (does exactly as it's meant to)
i have narrowed it down to this part
Quote: "for a = 2, 9 do
checked[a] = 0
end"
but see no issue with it?
video of what it does
life's one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11