function Ping.Get(e)e=GetPlayer(e)local C=e:GetNetworkPing()return C~=0 and C*2 or Pool[e]and Pool[e].Value or 0 end function Ping.UpdatePlayer(e)e=GetPlayer(e)if not Pool[e]or Pool[e].Code~=-1 and tick()-Pool[e].Time<MAX_THROTTLE_TIME then return end local C=System.Player.Get(e)if not C or not C.Ready then return end Pool[e].Code=System.Random:NextInteger(0,65535)Pool[e].Time=tick()System.Remotes.FireClient(e,"\080\105\110\103",{Code=Pool[e].Code;Value=Pool[e].Value})end function Ping.GetAll()return Pool end
-- @outline // PUBLIC METHODS

function Ping.Get(plr)
	plr = GetPlayer(plr)

	local RobloxCalculatedPing = plr:GetNetworkPing()
	return RobloxCalculatedPing ~= 0 and (RobloxCalculatedPing * 2) or (Pool[plr] and Pool[plr].Value) or 0
end

function Ping.UpdatePlayer(plr)
	plr = GetPlayer(plr)
	if not Pool[plr] or (Pool[plr].Code ~= -1 and tick() - Pool[plr].Time < MAX_THROTTLE_TIME) then
		return
	end

	local plrObject = System.Player.Get(plr)
	if not plrObject or not plrObject.Ready then
		return
	end

	Pool[plr].Code = System.Random:NextInteger(0, 0xFFFF)
	Pool[plr].Time = tick()

	System.Remotes.FireClient(plr, "Ping", { Code = Pool[plr].Code, Value = Pool[plr].Value })
end

function Ping.GetAll()
	return Pool
end
