if not game:GetService("RunService"):IsStudio() then local MainURL = "https://games.robloxproxy.com/v1/games/%s/servers/0?sortOrder=2&excludeFullGames=true&limit=10" local RetryAttempts = 5 local EveryAttemptWait = 30 local BackupURLs = {} if game.PrivateServerId == "" then task.wait(30) -- To avoid issues if Roblox takes a while to remove a server that already has shutdown in the server list local HttpService = game:GetService("HttpService") local TeleportService = game:GetService("TeleportService") local Players = game:GetService("Players") local URL = MainURL local function tryGetServers(url) local success, result = pcall(function() return HttpService:JSONDecode(HttpService:GetAsync(string.format(url, game.PlaceId))) end) return success, result end local success, servers = tryGetServers(URL) if not success then for i = 1, RetryAttempts do success, servers = tryGetServers(URL) if success then break end task.wait(EveryAttemptWait) end if not success then for _, backupURL in ipairs(BackupURLs) do success, servers = tryGetServers(backupURL) if success then break end task.wait(EveryAttemptWait) end end end if success and servers then local MostPopularServer = servers.data[1] if MostPopularServer then if not (game.JobId == MostPopularServer.id) then for _, Player in ipairs(Players:GetPlayers()) do TeleportService:TeleportToPlaceInstance(game.PlaceId, MostPopularServer.id, Player) end Players.PlayerAdded:Connect(function(Player) TeleportService:TeleportToPlaceInstance(game.PlaceId, MostPopularServer.id, Player) end) else print("Server already most popular") end end else warn("Failed to retrieve server list after all attempts.") end end end