How to send info to a server when creating it

My game uses a lobby system where you can join the main game with multiple people or alone, so I wanted to know if there’s any way to know if only a single or multiple people were sent to a server, this way I can alter the game based on if it’s Singleplayer or Multiplayer.

So I wanted to know how I could go about this. I thought of making the loading screen unskippable so there’s time for everyone to join the server so it can then check how many players are in game.

You can use MessagingService | Roblox Creator Documentation to contact the server with a string like: “Single” or “Multi”, then change the server type depending on the message received.

yeah but they note in the page that it’s inconsistent + how do I know when the server has been created

You can just use TeleportData, which can be retrieved in the server with GetJoinData.

2 Likes

This would be ur most effective way. Using the LocalPlayerArrivedFromTeleport from a local script you can determine the TeleportData sent from TeleportService:Teleport(gameId,Player,TeleportData,LoadingGUI) or however else you want to send it/use the function.

The better way would be to use TeleportAsync and get the TeleportData from GetJoinData.

1 Like