Skip to main content

PlayerMockReplicationFocusUtils

The streaming-focus set of a mock. The engine exposes no getter for a real Player's focuses, so the set lives on the mock where a test can read it back.

Use PlayerMock.addReplicationFocus, PlayerMock.removeReplicationFocus and PlayerMock.getReplicationFocuses.

Functions

addReplicationFocus

PlayerMockReplicationFocusUtils.addReplicationFocus(
playerPlayer,--

must be a PlayerMock

partBasePart
) → ()

The backing is a set, so adding a part already focused does nothing.

Use PlayerMock.addReplicationFocus.

removeReplicationFocus

PlayerMockReplicationFocusUtils.removeReplicationFocus(
playerPlayer,--

must be a PlayerMock

partBasePart
) → ()

Removing a part that is not focused is a no-op.

Use PlayerMock.removeReplicationFocus.

getReplicationFocuses

PlayerMockReplicationFocusUtils.getReplicationFocuses(
playerPlayer--

must be a PlayerMock

) → {BasePart}

Returns the parts currently focused on a mock, in the order they were added.

Use PlayerMock.getReplicationFocuses.

Show raw api
{
    "functions": [
        {
            "name": "addReplicationFocus",
            "desc": "The backing is a set, so adding a part already focused does nothing.\n\nUse [PlayerMock.addReplicationFocus].",
            "params": [
                {
                    "name": "player",
                    "desc": "must be a PlayerMock",
                    "lua_type": "Player"
                },
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/player-mock/src/Shared/Helpers/Methods/PlayerMockReplicationFocusUtils.lua"
            }
        },
        {
            "name": "removeReplicationFocus",
            "desc": "Removing a part that is not focused is a no-op.\n\nUse [PlayerMock.removeReplicationFocus].",
            "params": [
                {
                    "name": "player",
                    "desc": "must be a PlayerMock",
                    "lua_type": "Player"
                },
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 49,
                "path": "src/player-mock/src/Shared/Helpers/Methods/PlayerMockReplicationFocusUtils.lua"
            }
        },
        {
            "name": "getReplicationFocuses",
            "desc": "Returns the parts currently focused on a mock, in the order they were added.\n\nUse [PlayerMock.getReplicationFocuses].",
            "params": [
                {
                    "name": "player",
                    "desc": "must be a PlayerMock",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ BasePart }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 67,
                "path": "src/player-mock/src/Shared/Helpers/Methods/PlayerMockReplicationFocusUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerMockReplicationFocusUtils",
    "desc": "The streaming-focus set of a mock. The engine exposes no getter for a real `Player`'s focuses, so\nthe set lives on the mock where a test can read it back.\n\nUse [PlayerMock.addReplicationFocus], [PlayerMock.removeReplicationFocus] and\n[PlayerMock.getReplicationFocuses].",
    "source": {
        "line": 11,
        "path": "src/player-mock/src/Shared/Helpers/Methods/PlayerMockReplicationFocusUtils.lua"
    }
}