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

How do I fetch a list of servers?

Asked by 8 years ago

So for my game I wanna have a hub and it'll have a list of all the servers. How do I do that and how do I use TeleportService to teleport them to a specific server? Also how do I get the properties of the server. Such as how many players are in and who are the players.

0
I'm pretty sure you could use dataStore for the properties of the server theCJarmy7 1293 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

DataStores

We checked, and there doesn't appear to be an API for getting the server lists for a game, either inside or outside of a game. At that, there's not really any good ways to store specific data for servers inside of DataStores. What you can do however use use the ReserveServer method of TeleportService in conjunction with TeleportToPrivateServer because the returned access code is serializable and suitable for storage in DataStores.

Once you have the access code, add it to a table in a DataStore. To get the list of servers available, just get the list from the datastore and iterate through it.

Ad

Answer this question