There are 3 ways that I have used in the past for tables. I will show you 2 of them because the one with "table.insert" is useless.
SECTION 1
Here is the way used for inserting SINGLE contents such as ped names:
tableName = {
"my",
"dogg",
"died",
"yesterday",
}
To return an option from this table, use this: tableName[2] -- That will return the "dogg" part.
So to print the word "dogg", we would do this:
TextPrintString(tableName[2], 3, 2)
Note that the number 2 in there can be replaced with any variable, for example if you were to make a menu out of it...
SECTION 2
The same method used for storing multiple items:
tableName = {
{name = "tony", surname = "hawk"},
{name = "per", surname = "son"},
{name = "hel", surname = "lo"},
}
The return method in this part is really similar(if not same) to the inserting method.
To return it, use: tableName[2].name -- This will return the "per" option in this table.
So if we were using it in a TextPrintString(), we would do this:
TextPrintString("Hello, my name is "..tableName[1].name.." "..tableName[1].surname, 3, 1) -- The "" "" part is for a space
Also, the ".." between all the texts separates them. Meaning, if you wanted to put "my" and "name" in a text, you could do this: TextPrintString("my ".."name", 3, 1)
That would print "my name" for 3 seconds as the large text on the top of the screen.
if u would add me on steam, i could send u shit bruh. add me: tha virgo