Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to manipulate a server, or communicate between servers?

The player starts in the lobby (It's own place), then when they click start they are teleported to the main map

Problem: If they are just teleported, they could get teleported to a game that is full on players or has already started.

Below I have solutions that I have no idea how to put into place

Solution 1: After they server has enough players and starts, make itself unjoinable

Solution 2: Communicate with different servers to find how many players are in the server and if

it has started (getting the value of a bool object in the workspace). Then teleport the player to that specific server if it is valid to be joined.

I think that solution 1 is easier and has a better chance at being possible than the second solution.

I will also accept other solutions to help my problem. Thx in advance!

1 answer

✓ Accepted answer

You can use Messagingservice.

https://developer.roblox.com/en-us/api-reference/class/MessagingService

You can subscribe every Server to something like 'FindNotStartedServer' Name it however you want ;) and if the Server recives 'FindNotStartedServer' it Posts it's JobId

game.JobId

Then you can just teleport the Player to the first that arrives at the player's Server using TeleportService: https://developer.roblox.com/en-us/api-reference/class/TeleportService

https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToPlaceInstance

I hope this helps. :)

This discussion is preserved as it was. New answers, comments, and votes are closed.