get_comm_channel Synchronous
Look up a channel created with create_comm_channel by its numeric ID. Use this to share a simple event between pieces of code that do not share ordinary Luau tables.
Luau
get_comm_channel(id: number) -> CommChannel | BindableEvent | nilParameters
| Parameter | Type | Description |
|---|---|---|
id | number | Positive integer ID returned by create_comm_channel. |
Returns
CommChannel | BindableEvent | nilThe original CommChannel receiver in its owner state, the retained BindableEvent in another state, or nil for an unknown ID.
Luau
CommChannel = {Event: RBXScriptSignal, Internal: BindableEvent}Usage notes
A lookup across states returns a BindableEvent Instance; use its Event signal and Fire method there.
Example
Luau
local id, owner = create_comm_channel()
local sameState = get_comm_channel(id)
if sameState then
sameState:Fire("hello")
end