How to increment a variable name by 1 in Lua, and then set that as the variable name?
snippet in lua

How to increment a variable name by 1 in Lua, and then set that as the variable name?

user1079

local objects = {}

--> This will create 20 objects
for i=1, 20 do
    objects[i] = object:new{x = math.random(1,92), y = math.random(1,92), roomx = 0, roomy = 0, symbol = "t", name = "Tree"}
end