Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TeleportService = game:GetService("TeleportService")
- local HttpService = game:GetService("HttpService")
- local PlaceID = game.PlaceId
- local ServerListURL = "https://games.roblox.com/v1/games/" .. PlaceID .. "/servers/Public?sortOrder=Asc&limit=100"
- function GetRandomServer()
- local success, result = pcall(function()
- return HttpService:JSONDecode(game:HttpGet(ServerListURL))
- end)
- if success and result and result.data then
- local randomServer = result.data[math.random(1, #result.data)]
- if randomServer.playing < randomServer.maxPlayers and randomServer.id ~= game.JobId then
- return randomServer.id
- end
- end
- return nil
- end
- local NewServerID = GetRandomServer()
- if NewServerID then
- TeleportService:TeleportToPlaceInstance(PlaceID, NewServerID, game.Players.LocalPlayer)
- else
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "Server Hop",
- Text = "Couldn't find a server!",
- Duration = 5,
- Icon = "rbxassetid://76020773425692"
- })
- end
Advertisement
Comments
-
- Did u rlly have to obfuscate a server hop script
-
- yeah😎
Add Comment
Please, Sign In to add comment