mangttigod

omg_kora1

Jan 2nd, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. repeat wait() until game:IsLoaded()
  2.  
  3. local function jumpToServer()
  4. local sfUrl = "https://games.roblox.com/v1/games/%s/servers/Public?sortOrder=%s&limit=%s&excludeFullGames=true"
  5. local req = request({ Url = string.format(sfUrl, 15502339080, "Desc", 100) })
  6. local body = game:GetService("HttpService"):JSONDecode(req.Body)
  7. local deep = math.random(1, 3)
  8. if deep > 1 then
  9. for i = 1, deep, 1 do
  10. req = request({ Url = string.format(sfUrl .. "&cursor=" .. body.nextPageCursor, 15502339080, "Desc", 100) })
  11. body = game:GetService("HttpService"):JSONDecode(req.Body)
  12. task.wait(0.1)
  13. end
  14. end
  15. local servers = {}
  16. if body and body.data then
  17. for i, v in next, body.data do
  18. if type(v) == "table" and tonumber(v.playing) and tonumber(v.maxPlayers) and v.playing < v.maxPlayers and v.id ~= game.JobId then
  19. table.insert(servers, 1, v.id)
  20. end
  21. end
  22. end
  23. local randomCount = #servers
  24. if not randomCount then
  25. randomCount = 2
  26. end
  27. game:GetService("TeleportService"):TeleportToPlaceInstance(15502339080, servers[math.random(1, randomCount)], game:GetService("Players").LocalPlayer)
  28. end
  29.  
  30. while wait(1) do
  31. jumpToServer()
  32. end
Add Comment
Please, Sign In to add comment