Inserting a table into a table using table.insert

This is what I’m trying to do, I have a table called lobbys = {}. I’m trying to insert another table into it to make it look like this:

local lobbys = {
    ["Player"] = {}
}

I’ve tried to just insert the table like this:

table.insert(lobbys, #lobbys+1, {"Player"})

But it looks like this when I print it:

▼  {
      [1] =  ▼  {
            [1] = "Player"
      }
   }

I want it to look like this:

▼  {
      "Player" =   {
           [1] = true; -- etc what ever
      }
   }

table.insert only takes a number value for the position. If you want a table within a table with a key of “Player” then you will have to do

lobbys[“Player”] = {}

1 Like

thats just what i needed lol thanks

1 Like

or

local tbl = {}
tbl[#tbl+1] = 'my favorite youtuber is kekeyi bukan boneka'
1 Like