getServerIp
Client
Returns the address of the server this client is connected to.
string getServerIp([bool withPort = false])
Parameters
| Name | Type | Description |
|---|---|---|
| withPort | bool | If true, :port is appended.default false |
Returns
The address, with :port if asked. An empty string if the client is not connected.
Example
addCommandHandler("server", function()
print("connected to " .. getServerIp(true))
end)