AchieveStuffs

serverhop anomic script

Aug 23rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.54 KB | None | 0 0
  1. -- speed9000x15 https://v3rmillion.net/member.php?action=profile&uid=545407
  2. local PlaceID = 4581966615
  3. local AllIDs = {}
  4. local foundAnything = ""
  5. local actualHour = os.date("!*t").hour
  6. local Deleted = false
  7. local File = pcall(function()
  8.     AllIDs = game:GetService('HttpService'):JSONDecode(readfile("NotSameServers.json"))
  9. end)
  10. if not File then
  11.     table.insert(AllIDs, actualHour)
  12.     writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  13. end
  14. function TPReturner()
  15.     local Site;
  16.     if foundAnything == "" then
  17.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  18.     else
  19.         Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  20.     end
  21.     local ID = ""
  22.     if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  23.         foundAnything = Site.nextPageCursor
  24.     end
  25.     local num = 0;
  26.     for i,v in pairs(Site.data) do
  27.         local Possible = true
  28.         ID = tostring(v.id)
  29.         if tonumber(v.maxPlayers) > tonumber(v.playing) then
  30.             for _,Existing in pairs(AllIDs) do
  31.                 if num ~= 0 then
  32.                     if ID == tostring(Existing) then
  33.                         Possible = false
  34.                     end
  35.                 else
  36.                     if tonumber(actualHour) ~= tonumber(Existing) then
  37.                         local delFile = pcall(function()
  38.                             delfile("NotSameServers.json")
  39.                             AllIDs = {}
  40.                             table.insert(AllIDs, actualHour)
  41.                         end)
  42.                     end
  43.                 end
  44.                 num = num + 1
  45.             end
  46.             if Possible == true then
  47.                 table.insert(AllIDs, ID)
  48.                 wait()
  49.                 pcall(function()
  50.                     writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  51.                     wait()
  52.                     game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID, game.Players.LocalPlayer)
  53.                 end)
  54.                 wait(4)
  55.             end
  56.         end
  57.     end
  58. end
  59.  
  60. function Teleport()
  61.     while wait() do
  62.         pcall(function()
  63.             TPReturner()
  64.             if foundAnything ~= "" then
  65.                 TPReturner()
  66.             end
  67.         end)
  68.     end
  69. end
  70.  
  71. Teleport()
Add Comment
Please, Sign In to add comment