MLG_Rainbow

Low ping

Oct 11th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Http=game:GetService("HttpService")
  2. Player=game:GetService("Players").LocalPlayer
  3. T=game:GetService("TeleportService")
  4. local placeId=game.PlaceId
  5. local MaxPing=90
  6. local function GetCollection()
  7. local json=Http:JSONDecode(game:HttpGet("https://www.roblox.com/games/getgameinstancesjson?placeId="..placeId.."&startIndex=0"))
  8. return #json["Collection"]
  9. end
  10. local function GetServers()
  11. local servers={}
  12. for i=0,GetCollection() do
  13. local json=Http:JSONDecode(game:HttpGet("https://www.roblox.com/games/getgameinstancesjson?placeId="..placeId.."&startIndex="..tostring(i)))
  14. local collection=json["Collection"]
  15. for _,server in pairs(collection) do
  16. local Ping=server["Ping"]
  17. local MaxPlayers=server["Capacity"]
  18. local CurrentPlayers=server["CurrentPlayers"]
  19. if #CurrentPlayers<MaxPlayers and Ping<=MaxPing then
  20. table.insert(servers,server)
  21. end
  22. end
  23. end
  24. return servers
  25. end
  26. T:TeleportToPlaceInstance(placeId,GetServers()[1].Guid)
Add Comment
Please, Sign In to add comment