For example:
minion = {
hp = 1000,
x = 10,
y = 25
}
Is there any function that I can know how many variables exist within this table?
For example:
minion = {
hp = 1000,
x = 10,
y = 25
}
Is there any function that I can know how many variables exist within this table?
There is already a answer for size . To scroll through the elements:
minion = {
hp = 1000,
x = 10,
y = 25 }
for i, v in pairs(minion) do
print(i, "=>", v)
end
See running on ideone .