Getting a Server Id when teleporting to reserved servers

Hi. I am trying to make an obby racing game with 2 places - the lobby and the obby place.
I need to find a way to teleport a group of players to a reserved server and get the ServerID (JobId) of the server that I reserved. The TeleportService:TeleportToPrivateServer function does not return the JobId of the server, unlike the TeleportAsync or TeleportPartyAsync functions.
Is there a way to achieve this?
Thanks.

You can try TeleportService:ReserveServer() and MessagingService to send the JobId.

I had that idea too, but if I have multiple servers (which I will), the lobby server(s) couln’t know where that message is coming from.

You can pack the data of the match/round and send it or you can just use DataStoreService to save the match/round data.

For Datastores, I need a key and a value, if I dont have a key, how do I access a value?

Just create a DataStore named MatchHistory or other and set a new key according to the UserId, the value should be a table. Whenever the player joins a match, pack the match data and add it to the table.

There are multiple players being teleported at the same time. The server needs to get some data as soon as it starts.
The lobby place server does not know where the players were teleported to, because the TeleportAsync() function does not return a JobId.

Handle the data in the place where the match is conducted.

I need to send data to the server that I do not know the ID of. I can not handle the data on the obby place as it’s not there

1 Like

I don’t what you are talking, can you be more specific?