You can’t have a table named table to start with (table is a reserved word)
Please (always) format code posts (thanks):
Try this:
local t = { { name = "platform", id = p, x = 100, y = 200, }, { name = "RedGem", id = r, x = 100, y = 200 }, { name = "bgem", id = b, x = 100, y = 200 } } for k,v in pairs( t ) do print( k, v.name, v.id, v.x, v.y ) end
thanks for the reply I just didn;t notice that, but its working with table as tablename what actually didn’t work was value of v in for loop was not as expected but v.attribute worked
You can’t have a table named table to start with (table is a reserved word)
Please (always) format code posts (thanks):
Try this:
local t = { { name = "platform", id = p, x = 100, y = 200, }, { name = "RedGem", id = r, x = 100, y = 200 }, { name = "bgem", id = b, x = 100, y = 200 } } for k,v in pairs( t ) do print( k, v.name, v.id, v.x, v.y ) end
thanks for the reply I just didn;t notice that, but its working with table as tablename what actually didn’t work was value of v in for loop was not as expected but v.attribute worked