I’m getting this error on a module containing some level data, resulting in a bunch of other errors in the script that requires it:
ERROR:SCRIPT: /zones/test_level/test_level.lua:3: attempt to index a nil value
stack traceback:
/zones/test_level/test_level.lua:3: in main chunk
[C]: in function 'require'
/sonic/sonic#.script:104: in function </sonic/sonic#.script:100>
The weird thing is that this module worked perfectly fine before, and I haven’t touched it in some time. There aren’t any other errors above it in the console, so I can’t tell why this is happening. Here’s the module code:
local M = {}
M[1][0] = 16
M[1][1] = 16
M[1][2] = 16
M[1][3] = 16
M[1][4] = 16
M[1][5] = 16
M[1][6] = 16
M[1][7] = 16
M[1][8] = 16
M[1][9] = 16
M[1][10] = 16
M[1][11] = 16
M[1][12] = 16
M[1][13] = 16
M[1][14] = 16
M[1][15] = 16
M[1]["ang"] = 0
return M