Universal Script 📌
81.0k Views
273 Executions

Join lowest ping server

Universal Script 📌
swag
swagFirst script
3 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

Lets you join the server with the lowest ping for you

Updates

  1. Script edited: Create script

View Raw
local HTTPService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")
local StatsService = game:GetService("Stats")

local function fetchServersData(placeId, limit)
    local url = string.format("https://games.roblox.com/v1/games/%d/servers/Public?limit=%d", placeId, limit)
    local success, response =
        pcall(
        function()
            return HTTPService:JSONDecode(game:HttpGet(url))
        end
    )

    if success and response and response.data then
        return response.data
    end

    return nil
end

local placeId = game.PlaceId
local serverLimit = 100
local servers = fetchServersData(placeId, serverLimit)

if not servers then
    return
end

local lowestPingServer = servers[1]

for _, server in pairs(servers) do
    if server["ping"] < lowestPingServer["ping"] then
        lowestPingServer = server
    end
end

local commonLoadTime = 5
task.wait(commonLoadTime)

local pingThreshold = 100


Comments

1
Log in to join the conversation. Login
antonylabababidi's profile picture
antonylabababidi3 years ago(edited)

just keeps saying server full

1