getPlayerIP
Server
Returns the IP address the player is connected from, without the port.
string|false getPlayerIP(player player)
Parameters
| Name | Type | Description |
|---|---|---|
| player | player | The player, or the console element. |
Returns
The address, or false if it could not be read. For the console element, "127.0.0.1".
Example
addEventHandler("onPlayerJoin", root, function()
outputServerLog(getPlayerName(source) .. " joined from " .. tostring(getPlayerIP(source)))
end)