A table being created inside a table

So I’m still learning about tables but for some reason there’s a table being created inside of a table that holds players names
btw my name is under the blue line if your wonder why that’s there

	table.insert(Survivors, Players:GetChildren())

            print(Survivors)

Screenshot (327)_LI

It’s because :GetChildren() function returns a table. You gotta insert each players into the table manually if you want to store their information there.

for _,GetPlayer in pairs(Players:GetChildren())
   table.insert(Survivors, GetPlayer)
end

print(Survivors) -- Shows the result

Ohh okay, thanks I got it working now

Players:GetChildren() and Players:GetPlayers() both return an array of players already which you can then manipulate.

table.insert(Survivors, Players:GetChildren())

Would end up looking like:

Survivors = {{plr1, plr2, plr3}} etc. in other words a nested table.

GetPlayers()/GetChildren() return a single table only.