Rounds and Assigning Teams

Hello fellow developers!

I’m in a bit of a pickle at the moment. As I want to create a fighting game. In this fighting game, you will join into the lobby. Once the previous round is over, you will be randomly teleported to one of two teams. I don’t know how to accomplish this, and I would appreciate some help!

For instance, let’s say a player joins the lobby. About 2 to 3 minutes later, the previous round ends. I want to make it so that once the round is over, everyone is teleported back to the lobby, and there are randomly assigned teams.

I know it’s a lot, but any tips?