How do i make a waiting for players script?

I want to make a waiting for players script, so, when all the players in a group in a different game are teleported to the game, the game will start, but i don’t know how to do it, thanks for reading. :+1:

3 Likes

If the two games are in the same universe, then you can pass a table with all the players’ names to the other game and wait until all the players from that table joined.

Yeah, but now, if someone leaves before/after teleporting??

You could wait, say, 15 seconds and if the player didn’t join, just assume that they left and start the game.

I’m pretty sure this would be a pretty poor solution, considering people don’t have the same connection times.

But how do I send a table with the players?

You could use data store or I guess messaging service to send over a table of players to the another place as long as this other place is under the same game as the first one.

You can use TeleportData for this.
For more information visit TeleportService | Documentation - Roblox Creator Hub

3 Likes

Honesty waiting would not be a bad solution considering if your not in the game within 30 seconds you should not be playing anyway

I didn’t understand the page…

Here are some example scripts: TeleportService | Documentation - Roblox Creator Hub

2 Likes

Hate to bump a thread, but I’ve encountered the same issue, How would you use TeleportData to check if all the players are in the game? TeleportData is local so it’s only transfered to the client, and even if you fire it from the client to the server, the game has already started to run.

2 Likes

Good question! The first thing that pops up in my mind would be sending an int with the number of people “sent” to the new game and then taking that value from the first player that joined the game you sent them to. Then in the new game counting how many people have joined and comparing that to the value of the first person that joined.

Something like this should work, but you can play around with it.
Add me on Discord if you have any questions, Antony.#0001

1 Like

Sure thing! I added you bro, I may need to inquire further explanations :joy: