M MY Multiplayer: Wiki
Side
Kind

getPlayerIP

Server

Returns the IP address the player is connected from, without the port.

string|false getPlayerIP(player player)

Parameters

NameTypeDescription
playerplayerThe 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)

See also