Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there any API for Server Differentiation?

Asked by
Legojoker 345 Moderation Voter
8 years ago

I've been looking around on the wiki for a bit, but I haven't seem to come across the type of API I was looking for. What I'm interested in is something that differentiates servers between each other, so that each one has its own "ID" of sorts, and players could request teleportation to these specific "server IDs". Something like this:

http://prntscr.com/8t78pe

I'm lacking in knowledge of TeleportService API; I don't know if something like this already exists or not.

The reason I'm looking into this is because I was hoping to get real-time server information and link it to specific servers so players could teleport to different servers when they end up losing in a long-round-based game, so that they could keep playing constantly and not have to wait (provided the game isn't close to ending already). I know I could use data stores to transmit information about different servers, but I don't know if different servers can be differentiated.

If there isn't any API for this, does anyone recommend any alternatives? I'm open to any new ideas.

Thanks in advance for any API and/or suggestions!

EDIT: Maybe what I could do is have each active server choose a non-guest player at random and have their user IDs attached to values about the server, using the GetPlayerPlaceInstanceAsync to then get the server, and then have players that have lost rounds and are in need of a teleport get launched to these servers tethered in a changing data store based on IDs of PLAYERS in active servers with TeleportToPlaceInstance? Thoughts??

1 answer

Log in to vote
3
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

Each server has its own unique JobId (game.JobId). To teleport a player to a specific server, use TeleportToPlaceInstance (game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, jobId, player).)

0
Ah, ok thanks! Way less hassle than doing it my sketchy way xD. Legojoker 345 — 8y
Ad

Answer this question