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.
✓ ANSWER ACCEPTED
How would I get a list of all active servers for a place?
1 answer
✓ Accepted answer
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
local ds = game:GetService("DataStoreService"):GetGlobalDataStore()
local servers = ds:GetAsync("Servers")
in the other place do
local ds = game:GetService("DataStoreService"):GetGlobalDataStore()
local servers = ds:GetAsync("Servers")
if servers == nil then
servers = {}
end
table.insert(servers, game.GameID)
ds:SetAsync("Servers", servers)
1 comment
0
Thanks. Then I can just remove the server when the server shuts down.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
No, auto duels has the battles in the same place
wouldn't have to do this if roblox didnt remove server lists