Skip to main content

NetworkOwnerUtils

Provides utility functions to make it easy to work with network owners. This wraps this API because the API surface is actually quite bad.

See also: NetworkOwnerService

Functions

trySetNetworkOwner

NetworkOwnerUtils.trySetNetworkOwner(
partBasePart,
playerPlayer
) → ()

Tries to set the network owner. Otherwise warns about failure.

getNetworkOwnerPlayer

NetworkOwnerUtils.getNetworkOwnerPlayer(partBasePart) → Player?

Tries to get the network owner a part. If this can't be retrieved it defaults to nil, which is sort of like pretending to be a server.

isNetworkOwner

NetworkOwnerUtils.isNetworkOwner(
partBasePart,
playerPlayer?--

nil for server

) → boolean

Returns whether or not a player is a network owner. If it cannot be retrieved then it will return false.

isServerNetworkOwner

NetworkOwnerUtils.isServerNetworkOwner(partBasePart) → boolean

Returns whether or not the server is the network owner. Returns false if it can't be retrieved.

tryToGetNetworkOwner

NetworkOwnerUtils.tryToGetNetworkOwner(partBasePart) → (
boolean,--

true if retrieved fine, false otherwise

Player?--

player that is owner.

)
Show raw api
{
    "functions": [
        {
            "name": "trySetNetworkOwner",
            "desc": "Tries to set the network owner. Otherwise warns about failure.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 17,
                "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
            }
        },
        {
            "name": "getNetworkOwnerPlayer",
            "desc": "Tries to get the network owner a part. If this can't be retrieved\nit defaults to nil, which is sort of like pretending to be a server.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Player?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 36,
                "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
            }
        },
        {
            "name": "isNetworkOwner",
            "desc": "Returns whether or not a player is a network owner. If it\ncannot be retrieved then it will return false.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "player",
                    "desc": "nil for server",
                    "lua_type": "Player?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 55,
                "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
            }
        },
        {
            "name": "isServerNetworkOwner",
            "desc": "Returns whether or not the server is the network owner. Returns\nfalse if it can't be retrieved.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 74,
                "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
            }
        },
        {
            "name": "tryToGetNetworkOwner",
            "desc": "",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "true if retrieved fine, false otherwise",
                    "lua_type": "boolean"
                },
                {
                    "desc": "player that is owner.",
                    "lua_type": "Player?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 90,
                "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "NetworkOwnerUtils",
    "desc": "Provides utility functions to make it easy to work with network owners. This wraps this API\nbecause the API surface is actually quite bad.\n\nSee also: [NetworkOwnerService]",
    "source": {
        "line": 9,
        "path": "src/networkownerutils/src/Server/NetworkOwnerUtils.lua"
    }
}