Hello,
I have encountered a very strange and funny error, I hope someone can figure it out.
I pass a number to a function and use that number to access a value from a table, but the number which i pass becomes nil in the process.
Take a look at the following code.
local players = {} local bots = {} bots[1] = {name = "bot1", country = "USA"} bots[2] = {name = "bot2", country = "Russia"} local function test(num) local newCircle = display.newCircle(10,10,10) --strangely the "num" becomes nil in the following line newCircle.id = bots[num].name players[newCircle.id] = newCircle end test(1)