Universal Script 📌
14.5k Views
337 Executions

Best ping server joiner

Universal Script 📌
Vorti
VortiPublished 5
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

Joins the server with the best ping to have barley any lag

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
local serverStats = StatsService.Network.ServerStatsItem
local dataPing = serverStats["Data Ping"]:GetValueString()
local pingValue = tonumber(dataPing:match("(%d+)"))


Comments

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

Script got taken from Empire. Please, credit him.

1

More universal scripts

See all
Universal Script 📌
6.9k
13.3k
Bumped 11 minutes ago
Universal Script 📌
125.8k
929.4k
Bumped 41 minutes ago
Script hub
200.9k
2.3M
Bumped 4 hours ago
Key System

Script hub

#21 this week

Verified script badgeAirflow HUB

Script hub
3.7M
907.2k
Bumped 6 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeFlow Hub | 73 Games | Updated

Universal Script 📌
52
30
Approved 7 hours ago
Paid