Skip to content

Api > MLPlayer > UpdateReceiverChannels()


MLPlayer.UpdateReceiverChannels(number[] channelsToRemove, number[] channelsToAdd)⚓︎

Update receiving channel of the local client.

Parameters:⚓︎

Name Type Description
channelsToRemove number[] Channels to unsubscibe from receiving. Null will not remove any.
channelsToAdd number[] Channel to subscribe to receiver. Null will not add any.

Returns:⚓︎

type Description
boolean return true if operation succeed, otherwise false.

Usage⚓︎

---@type MLPlayer
local mlplayer;

---@type number
local channelsToRemove;

---@type number
local channelsToAdd;


local val0 = mlplayer.UpdateReceiverChannels(channelsToRemove, channelsToAdd)

Extra Detail⚓︎

By default, all players receive from channel 0. First, removing channels is executed. This way, you could leave all channels and join only the ones provided. Priority is always to channel addition: if the same channel is added to both arrays then the channel will be added.