Getting everything inside of a table

I’m wondering how I can get everything inside of a table.

What do you mean by this? if you want to do stuff to everything inside a table you can do

for _, v in pairs(table name here) do 
--do stuff
end

I want to use table.concat is what I meant, but I’m confusted how to use concat.

what are you using it for, it said that table.concat concatenates everything in the table into a string

I’m using it to get every person’s name in a table

i’m not sure if it’s exactly what you’re looking for, but this article provides some pretty good information regarding table.concat()

1 Like

Go look about tables on the wiki you can find some information of it there.

If you are trying to get individual names and do stuff with it I think it is better to use a for loop, but if you just want to display it you can check out the link dane sent

1 Like

I’m trying to get everyone’s name in the table is the problem.

The article mentioned by @Dane1up says

It’s erroring on this line.

TrainerTableS is not defined, that could be the problem

If its not defined it says Unknown Global “name”

Ah, I made a spelling error. Thanks for notifying me. However, it’s erroring with this after I fixed it.

can you show us the line that errored?

What’s it calling on line 39? hm

I think it is table.concat(tableName, “spacing”), so

value = table.concat(TrainerTable, '/n')
2 Likes

This works, but when I add multiple fields it stops working.

can you give us more details? what “fields” are you adding