0% found this document useful (0 votes)
36 views2 pages

Sever Hop

The document contains a Lua script for a Roblox game server hopping function. It retrieves public server data for a specific game, checks for available servers with fewer players than the maximum capacity, and teleports the player to a suitable server. The script also manages a list of previously visited servers to avoid revisiting them within the same hour.

Uploaded by

khataytb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Sever Hop

The document contains a Lua script for a Roblox game server hopping function. It retrieves public server data for a specific game, checks for available servers with fewer players than the maximum capacity, and teleports the player to a suitable server. The script also manages a list of previously visited servers to avoid revisiting them within the same hour.

Uploaded by

khataytb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

function HopServer()

local PlaceID = game.PlaceId


local AllIDs = {}
local foundAnything = ""
local actualHour = os.date("!*t").hour
local Deleted = false
--[[
local File = pcall(function()
AllIDs =
game:GetService('HttpService'):JSONDecode(readfile("NotSameServers.json"))
end)
if not File then
table.insert(AllIDs, actualHour)
writefile("NotSameServers.json",
game:GetService('HttpService'):JSONEncode(AllIDs))
end
]]
function TPReturner()
local Site;
if foundAnything == "" then
Site =
game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' ..
PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
else
Site =
game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' ..
PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
end
local ID = ""
if Site.nextPageCursor and Site.nextPageCursor ~= "null" and
Site.nextPageCursor ~= nil then
foundAnything = Site.nextPageCursor
end
local num = 0;
for i,v in pairs(Site.data) do
local Possible = true
ID = tostring(v.id)
if tonumber(v.maxPlayers) > tonumber(v.playing) then
for _,Existing in pairs(AllIDs) do
if num ~= 0 then
if ID == tostring(Existing) then
Possible = false
end
else
if tonumber(actualHour) ~=
tonumber(Existing) then
local delFile = pcall(function()
--
delfile("NotSameServers.json")
AllIDs = {}
table.insert(AllIDs,
actualHour)
end)
end
end
num = num + 1
end
if Possible == true then
table.insert(AllIDs, ID)
wait()
pcall(function()
-- writefile("NotSameServers.json",
game:GetService('HttpService'):JSONEncode(AllIDs))
wait()

game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ID,
game.Players.LocalPlayer)
end)
wait(4)
end
end
end
end

You might also like