Skip to content
Saiko

get_comm_channel

Returns the event object of a channel made with create_comm_channel, or nil when no channel has that id. Call it from inside an actor to reach the channel the main state listens on.

Signature

luau
get_comm_channel(id: number): BindableEvent?

Parameters

idnumber

The id create_comm_channel returned.

Returns

BindableEvent?

Note

Example

luau
local id, channel = create_comm_channel()
print(get_comm_channel(id) == channel) --> true
print(get_comm_channel(-1)) --> nil

channel.Event:Once(function(...)
    print(...) --> 1 2 3
end)

run_on_actor(getactors()[1], [[
    get_comm_channel(...):Fire(1, 2, 3)
]], id)