How do I get a player's ping?

What I tried was “local ping = game.Players.LocalPlayer:GetNetworkPing() * 2000” as I found in a topic by QuantixDev, but it doesnt return the exact ping shown in the Shift + F3 panel.

use remote function

local RemoteFunction

local function GetPing()
	local Start = tick()
	local ServerTime = RemoteFunction:InvokeServer()
	return ServerTime - Start, tick() - ServerTime
end

local Sent, Receive = GetPing()
print("Sent ping: ", Sent, "ms\nReceive ping: ", Receive, "ms")

server script below

RemoteFunction.OnServerInvoke = function()
	return tick()
end
3 Likes
local ping = player:GetNetworkPing()

This gives you the one-way ping. Multiply by 2 to get the full latency.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.