ChannelInfo
Represents a chat channel configuration returned by Chat:CreateChannel().
Use this to configure proximity chat and speaker filters for the channel.
Channels manage voice and text communication between players, allowing you to control who can speak to whom.
Example usage:
Properties
All players that have this channel as their active channel
Whether or not this channel allows text chat.
Whether or not this channel allows voice chat.
The chat channel the local player is currently active in
Whether the local player has the ability to switch to this channel
The unique name of the channel.
The list of players in the channel.
Filter function to control which players can speak in this channel. Return true to allow the player to speak, false to block them.
Use cases:
- Mute specific players
- Require certain conditions to speak (level, role, etc.)
- Implement custom mute systems
- Create "listen-only" channels
IMPORTANT: Server-side only.
--!Type(Server)
local announcementChannel = Chat:CreateChannel("Announcements", true, true)
-- Only moderators can speak
announcementChannel.SpeakerFilter = function(player)
return player.isModerator
end
-- All players added can listen, but only mods can speak
for i, player in ipairs(scene.players) do
Chat:AddPlayerToChannel(announcementChannel, player)
end
--!Type(Server)
-- Minimum level requirement to speak
local experiencedChannel = Chat:CreateChannel("Veterans", true, true)
experiencedChannel.SpeakerFilter = function(player)
-- Check player level from storage
local playerLevel = 1 -- Get from storage
return playerLevel >= 10
end
--!Type(Server)
-- Custom mute system
local mutedPlayers = {}
local mainChannel = Chat:CreateChannel("Main", true, true)
mainChannel.SpeakerFilter = function(player)
return not mutedPlayers[player.user.id]
end
-- Mute a player
function MutePlayer(player)
mutedPlayers[player.user.id] = true
Chat:ReapplyFilters(player) -- Refresh the filter
end
-- Unmute a player
function UnmutePlayer(player)
mutedPlayers[player.user.id] = nil
Chat:ReapplyFilters(player)
end
Methods
Disables proximity chat for this channel, making voice chat global. All players in the channel will hear each other at full volume regardless of distance.
IMPORTANT: Server-side only.
--!Type(Server)
-- Create a global voice channel
local globalChannel = Chat:CreateChannel("Global", true, true)
-- Disable proximity so everyone hears each other
globalChannel:DisableProximityChat()
-- Or re-enable it later
Timer.After(60, function()
globalChannel:EnableProximityChat(50, 10)
end)
Returns
Enables proximity-based voice chat for this channel. Voice volume decreases with distance between players.
Parameters:
- maxVolumeDistance: Distance in units where voice is at maximum volume
- minVolumeDistance: Distance in units where voice is at minimum volume (muted)
IMPORTANT: Server-side only. Only affects voice chat, not text chat.
--!Type(Server)
-- Create a proximity voice channel
local proximityChannel = Chat:CreateChannel("Proximity", true, true)
-- Voice is loudest within 10 units, fades until 50 units
proximityChannel:EnableProximityChat(50, 10)
-- Add all players
for i, player in ipairs(scene.players) do
Chat:AddPlayerToChannel(proximityChannel, player)
end
--!Type(Server)
-- Different zones with different proximity ranges
local whispearChannel = Chat:CreateChannel("Whisper", false, true)
whisperChannel:EnableProximityChat(5, 1) -- Very close range
local shoutChannel = Chat:CreateChannel("Shout", false, true)
shoutChannel:EnableProximityChat(100, 20) -- Long range
Parameters
maxVolumeDistance
minVolumeDistance
Returns
Parameters
player
Returns
Parameters
player
Returns
Updated 19 days ago