Anyway to print out every element of a table? Thanks
✓ ANSWER ACCEPTED
Anyway to print out every element of a table?
2 answers
✓ Accepted answer
Yes, and that is with pairs().
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#pairs
t = {a = 1, b = 2, c = 3}
for i, v in pairs(t) do
print(i..": "..v)
end
You can use the table.concat()inside the print. Don't have to use the forloop.
table.concat() page
print(table.concat(NameOfYourTable, ", "))
Output>>elements, in, your, table
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Actually the pairs is a function, it's the for that is a loop.