Why doesn't Speaker:JoinChannel() force the player into that channel? If so, how do I force the player in it?

I am trying to make separate chat channels for a “Dead” and “Alive” team. This is what I came up with.

local AliveChannel = ChatService:AddChannel(aliveChannel)
AliveChannel.Joinable = false
AliveChannel.AutoJoin = false
AliveChannel.Private = true
AliveChannel.Leavable = false
AliveChannel.WelcomeMessage = "You are Alive."

local DeadChannel = ChatService:AddChannel(deadChannel)
DeadChannel.Joinable = false
DeadChannel.AutoJoin = false
DeadChannel.Private = true
DeadChannel.Leavable = false
DeadChannel.WelcomeMessage = "You are Dead."

function changeChannel(obj)
    local Player = Players:FindFirstChild(obj.Name)
	if Player then
		local Speaker = ChatService:GetSpeaker(obj.Name)
		Speaker:LeaveChannel(deadChannel)
        Speaker:JoinChannel(aliveChannel)
    end
end	

This script creates two new channels and once changeChannel(obj) is called, the speaker is notified of the aliveChannel’s welcome message but doesn’t actually chat in that channel when typing. Instead, the player has to automatically say “/c Alive”, and THEN he can now chat in the private channel. I want to force this behavior automatically.

1 Like

I know I’m really late but I came across the same situation as you. If you or someone else who is reading this needs help, you need to use speaker:SetMainChannel("Example") in order for it to work after making the player join the channel.

3 Likes