Skip to main content

ScopeCommunicator

This item only works when running on the client. Client

Scope Communicators allow Client Objects to easily communicate with eachother.

Instead of using plain BindableEvents/BindableFunctions to communicate between Client Objects, use these.

Functions

destroy

ScopeCommunicator.destroy(selfany) → ()

Destroys the Communicator, disabling its use.

listen

ScopeCommunicator:listen(callback() → ()) → ()

Listens for events to the Communicator, executing the callback function when the Communicator is fired.

listenOnce

ScopeCommunicator:listenOnce(callback() → ()) → ()

Wrapper for the listen function that automatically disconnects after one event.

listenWait

ScopeCommunicator:listenWait() → ()

Wrapper for the listenOnce function that will yield until an event is fired.

fire

ScopeCommunicator:fire(...any) → ()

Fires the Communicator with the arguments provided.

request

ScopeCommunicator:request(...any) → ()

Requests a Communicator based on the provided arguments.

getCommunicator

ScopeCommunicator:getCommunicator(
type_TDefs.COMMUNICATOR_TYPES,
keystring
) → ()

Creates a Communicator with the given type and key.

Current valid types are "event" and "request"

  • "event" types are BindableEvents
  • "request" types are BindableFunctions
Show raw api
{
    "functions": [
        {
            "name": "listen",
            "desc": "Listens for events to the Communicator, executing the `callback` function\nwhen the Communicator is fired.",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 544,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "listenOnce",
            "desc": "Wrapper for the `listen` function that automatically disconnects after one event.",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 589,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "listenWait",
            "desc": "Wrapper for the `listenOnce` function that will yield until an event is fired.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 613,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "fire",
            "desc": "Fires the Communicator with the arguments provided.",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 638,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "request",
            "desc": "Requests a Communicator based on the provided arguments.",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 663,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "destroy",
            "desc": "Destroys the Communicator, disabling its use.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 686,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        },
        {
            "name": "getCommunicator",
            "desc": "Creates a Communicator with the given `type` and `key`.\n\nCurrent valid `type`s are \"event\" and \"request\"\n- \"event\" types are BindableEvents\n- \"request\" types are BindableFunctions",
            "params": [
                {
                    "name": "type",
                    "desc": "",
                    "lua_type": "_TDefs.COMMUNICATOR_TYPES"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 720,
                "path": "mirror/Kit.Managers.ScopeConstructor.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ScopeCommunicator",
    "desc": "Scope Communicators allow Client Objects to easily communicate with eachother.\n\nInstead of using plain BindableEvents/BindableFunctions to communicate between Client Objects,\nuse these.",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 515,
        "path": "mirror/Kit.Managers.ScopeConstructor.luau"
    }
}