getPlayerPing
Server
Returns the player's ping to the server, as measured by the connection.
Also exists on the client, with its own implementation: getPlayerPing
int|false getPlayerPing(player player)
Parameters
| Name | Type | Description |
|---|---|---|
| player | player | The player. |
Returns
The ping in milliseconds, or false if the element is not a player.
Example
setTimer(function()
for _, player in ipairs(getPlayers()) do
if getPlayerPing(player) > 500 then
kickPlayer(player, "ping too high")
end
end
end, 10000, 0)