Lua attempt to index ? (a nil value)
snippet in lua

Lua attempt to index ? (a nil value)

user5422

local t = '0'
print(t)
-- below prints exactly the same as variable t above
local u = 0
print(u)

local temp = { [0] = true }
-- try to index into the temp table with '0'
print(temp[t]) -- undefined