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.

Syntax
Luau
get_comm_channel(id: number) -> CommChannel | BindableEvent | nil

Parameters

Function parameters
ParameterTypeDescription
idnumberPositive integer ID returned by create_comm_channel.

Returns

CommChannel | BindableEvent | nil

The original CommChannel receiver in its owner state, the retained BindableEvent in another state, or nil for an unknown ID.

CommChannel fields
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

Example
Luau
local id, owner = create_comm_channel()
local sameState = get_comm_channel(id)
if sameState then
    sameState:Fire("hello")
end
Kawaii documentation