Advertisement
_Thanh_Thy_Cute_

Grand Piece Online AUTO HOP GUI

Sep 22nd, 2021
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. --Startup
  2. --The script will wait 30 minutes and then server hop to a random server and repeat. Does not need to be placed in AutoExec.
  3. --probably Synapse Only because it uses syn.request.
  4. if not game:IsLoaded() then
  5. game.Loaded:Wait()
  6. end
  7.  
  8. --Vars
  9. local HttpService = game:GetService("HttpService")
  10. local TeleportService = game:GetService("TeleportService")
  11. local max_Players = 20
  12. local autoHopTimer = 1600
  13. local hop_toggle = false
  14. local servers = {}
  15.  
  16. --Loads or creates settings
  17. if syn then
  18. if isfile('GPO_Hopper.json') then
  19. local settings_contents = readfile('GPO_Hopper.json')
  20. local settings_data = HttpService:JSONDecode(settings_contents)
  21. max_Players = settings_data.max_Players
  22. autoHopTimer = settings_data.autoHopTimer
  23. print("Loaded AutoHop settings. Max Players:" .. tostring(max_Players) .. " Timer:" .. tostring(autoHopTimer))
  24. else
  25. max_Players = 20
  26. autoHopTimer = 1600
  27. local settings_format = {max_Players = max_Players,autoHopTimer = autoHopTimer}
  28. local settings_data = HttpService:JSONEncode(settings_format)
  29. writefile('GPO_Hopper.json',settings_data)
  30. end
  31. end
  32.  
  33. local ezlib = loadstring(game:HttpGet("https://raw.githubusercontent.com/debug420/Ez-Hub/master/Modules/EzLib.lua"))();
  34. print("GPO Auto Hopper | Started.")
  35.  
  36. --Functions
  37. --TP Function
  38. local function teleport()
  39. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/PurityWasHere/Scripts-To-Test/main/Hopper.lua'))()")
  40. print('Queued Script for after TP.')
  41. pcall(function()
  42. local Response = syn.request({
  43. Url = "https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100",
  44. Method = "GET"})
  45. local data = HttpService:JSONDecode(Response.Body)
  46. for _, server in pairs(data.data) do
  47. if server.maxPlayers <= max_Players then
  48. table.insert(servers,server.id)
  49. end
  50. end
  51. local value = math.random(1,#servers)
  52. local picked_value = servers[value]
  53. game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, tostring(picked_value))
  54. end)
  55. end
  56.  
  57. --TP Timer
  58. local function Start_timer()
  59. wait(autoHopTimer)
  60. if hop_toggle == false then
  61. teleport()
  62. else
  63. print("Hop was disabled. Starting Timer Again!")
  64. Start_timer()
  65. end
  66. end
  67.  
  68. --Settings Saver
  69. local function write_settings()
  70. print('Writing Settings')
  71. local temp_settings = {max_Players = max_Players,autoHopTimer = autoHopTimer}
  72. local temp_settings_data = HttpService:JSONEncode(temp_settings)
  73. writefile('GPO_Hopper.json',temp_settings_data)
  74. end
  75.  
  76.  
  77. --UI
  78. local mainGUI = ezlib.create("GPO | Auto Hopper");
  79. local mainTab = mainGUI.newTab("Main");
  80. local creditsTab = mainGUI.newTab("Credits");
  81. mainTab.newTitle("Main");
  82. mainTab.newDiv();
  83. creditsTab.newTitle("Credits");
  84. creditsTab.newDiv();
  85.  
  86. --UI Functions
  87. mainTab.newCheckbox("Disable Hop!",false,function(state)
  88. hop_toggle = state
  89. print(state)
  90. end)
  91.  
  92. mainTab.newButton("Server Hop!",function()
  93. teleport()
  94. end)
  95.  
  96. mainTab.newSlider("Max Players",max_Players,0,25, function(state)
  97. max_Players = state
  98. write_settings()
  99. end)
  100.  
  101. mainTab.newTextbox("AutoHop Timer (seconds)",tostring(autoHopTimer),function(state)
  102. autoHopTimer = tonumber(state)
  103. write_settings()
  104. end)
  105.  
  106. creditsTab.newButton("Made by Pure!",function()
  107. end)
  108.  
  109. creditsTab.newButton("UI Lib by CDXX",function()
  110. end)
  111.  
  112. mainGUI.openTab(mainTab);
  113. Start_timer()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement