So I'm trying to make a game, where you start in a hub before the game. In the hub, I have Join Random Server, but I would like to have a list of all active servers, and if a friend in in a server, then recommend it to the player. I have looked through the wiki, but have found nothing. I know it's possible, because Auto Duels was able to do it.
You can try this which creates a datastore that has the GameID of every single server in the other place in the Universe
in the main place do
1 | local ds = game:GetService( "DataStoreService" ):GetGlobalDataStore() |
2 | local servers = ds:GetAsync( "Servers" ) |
in the other place do
1 | local ds = game:GetService( "DataStoreService" ):GetGlobalDataStore() |
2 | local servers = ds:GetAsync( "Servers" ) |
3 | if servers = = nil then |
4 | servers = { } |
5 | end |
6 | table.insert(servers, game.GameID) |
7 | ds:SetAsync( "Servers" , servers) |