Universal Script 📌
2.5k Views
56 Executions

new serverhop

Universal Script 📌
mzeen
mzeenFirst script
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

uhm serverhop

View Raw
local httprequest = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request

local function serverHop()
    local function notify(title, message)
        game:GetService("StarterGui"):SetCore("SendNotification", {
            Title = title,
            Text = message,
            Duration = 5
        })
    end
    
    if httprequest then
        notify("Serverhop", "Searching for a new server...")
        
        local HttpService = game:GetService("HttpService")
        local PlaceId = game.PlaceId
        local JobId = game.JobId
        local TeleportService = game:GetService("TeleportService")
        local LocalPlayer = game:GetService("Players").LocalPlayer
        
        local req = httprequest({
            Url = string.format("https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Desc&limit=100&excludeFullGames=true", PlaceId)
        })
        
        local success, body = pcall(function()
            return HttpService:JSONDecode(req.Body)
        end)
        
        if success and body and body.data then
            local servers = {}
            
            for _, server in pairs(body.data) do
                if server.playing < server.maxPlayers and server.id ~= JobId then
                    table.insert(servers, server)
                end
            end
            
            if #servers > 0 then
                local selectedServer = servers[math.random(1, #servers)]
                


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
4.0M
2.4M
Bumped 57 minutes ago

Script hub

Hall of Fame #3

KeylessVerified script badge[KEYLESS] Moondiety Script | 27+ supported Games

Script hub
197.3k
2.1M
Bumped 2 hours ago
Key System

Script hub

#21 this week

Verified script badgeAirflow HUB

Universal Script 📌
117
239
Approved 7 hours ago