Advertisement
ou1z

Untitled

May 8th, 2021
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. if syn.queue_on_teleport then
  2.     syn.queue_on_teleport('game:GetService("ReplicatedFirst"):RemoveDefaultLoadingScreen()')
  3. end
  4. local Decision = "any"
  5. local GUIDs = {}
  6. local maxPlayers = 0
  7. local pagesToSearch = 100
  8.  
  9. local Http = game:GetService("HttpService"):JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100&cursor="))
  10. for i = 1,pagesToSearch do
  11.     for i,v in pairs(Http.data) do
  12.         if v.playing ~= v.maxPlayers and v.id ~= game.JobId then
  13.             maxPlayers = v.maxPlayers
  14.             table.insert(GUIDs, {id = v.id, users = v.playing})
  15.         end
  16.     end
  17.     if Http.nextPageCursor ~= null then Http = game:GetService("HttpService"):JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100&cursor="..Http.nextPageCursor)) else break end
  18. end
  19. game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, GUIDs[math.random(1,#GUIDs)].id, cmdlp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement