Advertisement
Peerapat_PKY

Check_Loed_map AD

Aug 5th, 2024
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. local PlaceID = game.PlaceId
  2. local AllIDs = {}
  3. local foundAnything = ""
  4. local actualHour = os.date("!*t").hour
  5. local Deleted = false
  6.  
  7. function TPReturner()
  8. local Site;
  9. if foundAnything == "" then
  10. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  11. else
  12. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  13. end
  14. local ID = ""
  15. if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  16. foundAnything = Site.nextPageCursor
  17. end
  18. local num = 0;
  19. for i,v in pairs(Site.data) do
  20. local Possible = true
  21. ID = tostring(v.id)
  22. if tonumber(v.maxPlayers) > tonumber(v.playing) then
  23. for _,Existing in pairs(AllIDs) do
  24. if num ~= 0 then
  25. if ID == tostring(Existing) then
  26. Possible = false
  27. end
  28. else
  29. if tonumber(actualHour) ~= tonumber(Existing) then
  30. local delFile = pcall(function()
  31. AllIDs = {}
  32. table.insert(AllIDs, actualHour)
  33. end)
  34. end
  35. end
  36. num = num + 1
  37. end
  38. if Possible == true then
  39. table.insert(AllIDs, ID)
  40. wait()
  41. pcall(function()
  42. wait()
  43. game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID, game.Players.LocalPlayer)
  44. end)
  45. wait(4)
  46. end
  47. end
  48. end
  49. end
  50.  
  51. function Teleport()
  52. while wait() do
  53. pcall(function()
  54. TPReturner()
  55. if foundAnything ~= "" then
  56. TPReturner()
  57. end
  58. end)
  59. end
  60. end
  61.  
  62.  
  63.  
  64. local lobbyCount = 0
  65. local maxLobbyCount = 60
  66.  
  67. repeat task.wait(20) until game:IsLoaded()
  68. pcall(function()
  69. spawn(function()
  70. while true do
  71. local Map
  72. local IntroGui = game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("MatchIntroGui")
  73. if IntroGui then
  74. Map = "In Game"
  75. break
  76. else
  77. Map = "In Lobby"
  78. lobbyCount = lobbyCount + 1
  79. end
  80.  
  81. print("สถานะปัจจุบัน: " .. Map)
  82. print("จำนวนครั้งที่เจอ 'In Lobby': " .. lobbyCount)
  83.  
  84.  
  85. if lobbyCount >= maxLobbyCount then
  86. print("เจอ 'In Lobby' ครบ 20 ครั้ง ออกจากลูป")
  87. Teleport()
  88. break
  89. end
  90.  
  91. wait(1)
  92. end
  93. end)
  94. end)
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement