Skip to main content

PlayerGuiUtils

Helper methods for finding and retrieving the PlayerGui instance

Functions

getPlayerGui

PlayerGuiUtils.getPlayerGui() → PlayerGui

Finds the current player gui for the Players.LocalPlayer property or errors.

warning

This method errors if it can't find the PlayerGui. Fortunately, the PlayerGui is pretty much guaranteed to exist in most scenarios.

findPlayerGui

PlayerGuiUtils.findPlayerGui() → PlayerGui | nil

Finds the current player gui for the Players.LocalPlayer property.

Show raw api
{
    "functions": [
        {
            "name": "getPlayerGui",
            "desc": "Finds the current player gui for the [Players.LocalPlayer] property or errors.\n\n:::warning\nThis method errors if it can't find the PlayerGui. Fortunately, the PlayerGui is pretty much\nguaranteed to exist in most scenarios.\n:::",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PlayerGui"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 20,
                "path": "src/uiobjectutils/src/Client/PlayerGuiUtils.lua"
            }
        },
        {
            "name": "findPlayerGui",
            "desc": "Finds the current player gui for the [Players.LocalPlayer] property.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PlayerGui | nil"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 39,
                "path": "src/uiobjectutils/src/Client/PlayerGuiUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerGuiUtils",
    "desc": "Helper methods for finding and retrieving the [PlayerGui] instance",
    "source": {
        "line": 5,
        "path": "src/uiobjectutils/src/Client/PlayerGuiUtils.lua"
    }
}