# I don't Understand "How Lua save data on the same variable when we Iterate over it"

I know Lua remember value in the same field/function with the Same defined Variable. but I still lack the concept behind it. Let’s say I’see Int Variable = 2 which can be modify if we iterate over it Int variable = 8 Same logic I was applying on the Code. I got the results, but… Read More I don't Understand "How Lua save data on the same variable when we Iterate over it"

# What does "table:insert()" do?

I understand what colon syntax does. I know what table.insert(list, value) does. I’m also aware that I cannot create my own table t={} and insert a value to it with t:insert(value). But when I do table:insert(value) it inserts the value to table which is supposed to a type, right? The worst thing is that I… Read More What does "table:insert()" do?

# Lua : Iterating through nested tables

I am trying to iterate through the table in lua, but somehow I am not able to print the values inside the table. It prints the address SeriesPoint = {} function SeriesPoint:new(x, y) local newSeriesPoint = {} setmetatable(newSeriesPoint, self) self.__index = self self.x = x self.y = y return newSeriesPoint end TestSeriesPoint = {} table.insert(TestSeriesPoint… Read More Lua : Iterating through nested tables

# How to remove key value from the table in loop in Lua

So, I created a table A_table and my goal is to create a set of three hands Hand and then I wanted to remove the last two sets from the table i.e key 2 and 3 A_table = {} for i = 1, 3 do local Hand = { [‘parts’] = { type = ‘arm’,… Read More How to remove key value from the table in loop in Lua

# How to print single value of a table in lua

I can’t figure out how to print a single value in tab2. I’m trying to get the same result of when I print tab1. I don’t care about the order I just need to print a single pair(get the the key and the value), or pop it from the tab2 (with something like table.remove(tab1,1)) tab1=… Read More How to print single value of a table in lua