Creating a labby and queueing/matchmaking system for a 3v3 game

I know core already has queueing systems in place. But what I want to do is to create a lobby, where you can choose what class you want to be, invite friends and other stuff. Then I want the player, or the party to be able to queue up and get in the same game as one team. But I dont want the game to be a massive multiplayer game I want it to be quick 3v3 battles.

I dont know how the script would know that there are six people from maybe different servers wanting to play a match. Then group them together, send them to a child game (if thats even possible anymore), and then start a match.

Imagine Apex legends but with 3v3 matches.

Any help is appreciated. I am doing my own research. Im a migrated roblox developer, so if you only have some small tips I would love to hear them:) Thanks