How do I insert a table inside another table?

I was creating a data store system with tables, and I was able to understand the problem I was having. But my question is, how do I use

table.insert()

creating a table as parameters?

first parameter is the table, second is the position, and the third is the value
it can be used in two ways

table.insert(Table, Value)

or

table.insert(Table, Position, Value)

Yes my bro, I know that, but my question is: how do I insert a table inside a table itself, not a value.

like


local MyTable = {}
table.insert(MyTable,  the table) 

this would work

local mainTable = {}
local tableToInsert  = {}

table.insert(mainTable,tableToInsert)

Another way to do this is

local mainTable = {}

mainTable["Key"] = {}

this table can be accessed by

mainTable["Key"]
4 Likes

a table is a value you can insert, @TheBrainy06’s script shows this

EDIT: if this wasn’t true then we couldn’t use matrices

1 Like