I've got a piece of code, trying to insert some values into a table, as below.
local table1, table2, table3 = {}
function somefunction(inputtable)
for k,v in pairs(inputtable) do
if k == "1" then
table.insert(table1, v)
elseif k == "2" then
table.insert(table2, v)
end
end
end
I get an error referencing one of the table insert lines, like this:
extractorController.lua:34: bad argument #1 to 'insert' (table expected, got nil)
stack traceback:
[C]: in function 'insert'
extractorController.lua:34: in function 'somefunction'
[C]: in function 'xpcall'