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
(
self:
any
) →
(
)
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
,
key:
string
) →
(
)
Creates a Communicator with the given type
and key
.
Current valid type
s are "event" and "request"
- "event" types are BindableEvents
- "request" types are BindableFunctions