getPlayerPing
Client
Returns a player's ping. For the local player, it is this client's ping to the server; for the others, what the server reported about them.
Also exists on the server, with its own implementation: getPlayerPing
int|false getPlayerPing(player player)
Parameters
| Name | Type | Description |
|---|---|---|
| player | player | The player. |
Returns
The ping in milliseconds, 0 while it is not known, or false if the element is not a player.
Example
addEventHandler("onClientRender", root, function()
dxDrawText("ping: " .. getPlayerPing(localPlayer), 10, 10)
end)