Forcing players into chat channels

Hello Developers,

I am wondering if anyone would happen to know how to force players into chat channels after making them join. It was easy enough to create both an “Alive” and “Dead” channel for my game and put players into it based on certain events; however, the only way to actually speak in the channel is after typing “/c .” Is there any feasible way to force players into their channels? And yes I have searched through every tutorial I could before asking this question.

I have not actually, but he is experiencing the same problem as me it seems.

1 Like

Try this I think?

I appreciate the fast response but nothing on there forces the player into a channel. I can only edit the channel properties with those commands. Unless I missed something.

There is a property called “Leaveable”, try that?image

I’m pretty sure the speaker can’t so easily “leave” the channel. I’ve already tried speaker:LeaveChannel(“All”), which would work regardless of the “Leavable” property yet it corrupted the entire chat. I believe it has to do with something deep in the chat modules and I might have to fork the chat?

use the MuteSpeaker for alive, then the ChatSpeaker:LeaveChannel and ChatSpeaker:JoinChannel() for the dead chat.

Am I supposed to mute the speaker from the “All” channel?
I got errors from the chat modules.
Here is a simplified form of what I have.

local function SwitchChannel(player)
	local channel = ChatService:GetChannel("All")
	local speaker = ChatService:GetSpeaker(player.Name)
	channel:MuteSpeaker(speaker)
end

remote.OnServerEvent:Connect(SwitchChannel)

image_2021-05-27_014845

Where do you fire the remote event?

I’ve got a local script that checks for when the player changes teams. “Lobby” and “Playing” The remote fired from there.

I got this error too - and found that it’s because mutespeaker doesn’t user the chatservice:Getspeaker, it uses player.name.

local function SwitchChannel(player)
	local channel = ChatService:GetChannel("All")
	channel:MuteSpeaker(player.Name)
end

Should work.