# 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.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Players and accounts
- **URL**: https://wiki.mymp.gg/en/getPlayerPing-client
- **Counterpart**: Also exists on the server, with its own implementation: [getPlayerPing (Server)](https://wiki.mymp.gg/en/getPlayerPing-server.md)

## Syntax

```lua
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

```lua
addEventHandler("onClientRender", root, function()
    dxDrawText("ping: " .. getPlayerPing(localPlayer), 10, 10)
end)
```

## See also

- [getPlayerPing (Server)](https://wiki.mymp.gg/en/getPlayerPing-server.md): Returns the player's ping to the server, as measured by the connection.
- [dxDrawText (Client)](https://wiki.mymp.gg/en/dxDrawText.md): Draws text on the screen for one frame, inside a box.
