Trouble making a matchmaking system.1

I have a lobby, which when you hit the play button, teleports you to another place. The other place waits until there are three or more players in the server before it starts counting down. After the countdown, the game will have started. How can I efficiently prevent people from joining after the game has started without the use of kicking, or teleporting again (as the process will be very slow for some devices)
I am not asking for code (unless if I need help scripting this later on) I would just like to have an idea of where to start.
I could not find solutions that matches my case.

Please tell me if I forgot to put some information
Thanks - Blox

2 Likes

Alright so you would need to make the players teleport to a private server so others can’t join.

local TeleportService = game:GetService(“TeleportService”)

local ServerData = TeleportService:ReserveServer(PlaceID)
TeleportService:TeleportToPrivateServer(PlaceID, ServerData, players)

You have to do something like this inside your teleport script to make it work. Hope this was helpful! :grinning_face_with_smiling_eyes:

Yeah, I thought about that, but then how would I get more players before the game starts? Would I have to use messaging service (which I am familiar of)?

you could make the game wait for all players to load in which is the best thing to do instead of a countdown but if it takes too long it stops waiting to load all players. Or you could make it so the game starts when a certain amount of players loaded (70%) I don’t really know sorry.

Oh wait, you should make a lobby where you make a party and that should be able to fix your problem.

but I would like the game to be public, and also because it is public, I can’t make it support parties

Oh then I don’t know what to do to help you, im sorry.

1 Like

Here is my idea:

Using messagingservice, I communicate with all the servers, the first one to respond with a reserved server code will be the server the player teleports to, if no servers than create one, and dont respond when the game has started.

Edit:

Not quite sure how to (securely) get the reserved id from the server itself after loads of research

That doesn’t seem like a bad idea but if friends want to be in a server together what would you do?

Well, I already implemented a join by code feature. All they need is the code shown in the lobby of the friends game

1 Like

I have another error, but the error is for another post.