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


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
