ChatService:AddChannel() not working?

I followed this post’s solution along with Roblox’s official tutorial to try and achieve this. However it doesn’t work. I have no idea what is the issue. I made sure everything is followed correctly. What is wrong with this code?

local function Run(ChatService)
	local myChannel = ChatService:AddChannel("MyChannel")

	-- Set the message that is shown when a user joins the channel 
	myChannel.WelcomeMessage = "Welcome to my channel!"
	-- Causes players to automatically join the channel when they enter the game
	myChannel.AutoJoin = true
	print("RUN")
end

return Run

To create the channel

local chatServiceModule = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

local channel = chatServiceModule:AddChannel("MyChannel")

Already did that, still doesn’t work.

Im new to know that you can return a value out Of the function

That helps nothing in this topic.

How does it work? Return value out Of the function?

I’ve made it auto join which is true, and the welcome message should pop up when I join, but it didn’t. This already proves I am not in the channel.

Im just kidding btw try this :


local function Run(ChatService)
	local myChannel = ChatService:AddChannel("MyChannel")
	myChannel.WelcomeMessage = "Welcome to my channel!"
	
	myChannel.AutoJoin = true
end
 
return Run

That is literally the same code as I have.

Or return “RUN” like that no need to print

The print statement did work and acts as a testing to make sure the function did run.

Can you send a pic Of the output

robloxapp-20211227-1536481.wmv (1.6 MB)

You have the make the channel bar show in order to add channels.

In ChatSettings, there is a setting that can let the channel bars show. When its on, you then can add channels.

1 Like

Can you show me where it s exactly?

1 Like

Yep. Make a local script in StarterPlayerScripts. Name it whatever you want.

The local script will be used to overwrite the chat’s default settings. Whenever you want to overwrite a setting for Roblox’s chat, you can use this:

-- Require the ChatSettings module (wait for it to load)
local Chat = game:GetService("Chat")
local ClientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ClientChatModules:WaitForChild("ChatSettings"))

ChatSettings.ShowChannelsBar = true -- This is what you want

You can find a list of all the ChatSettings in this link, but showing the ChannelBar is all you need for what you’re asking for

Once you have the ChatChannels visible you can THEN add channels.

1 Like

There’s no problem here. AddChannel is working as expected and so is your module. The problem is how you’re testing it – you never tried speaking in the new channel. Remember that if you do not have the ShowChannelsBar setting enabled you need to use /c [channelName] to start speaking in it.

EDIT: If your main concern is that your welcome message isn’t showing up, they can be a little finnicky with auto joining channels. It does normally appear when manually using JoinChannel though later into a session’s lifetime but I haven’t really dissected auto joins in a while.

2 Likes

That’s what I mentioned in my reply. You can only see channels visually if you have the ShowChannelBar setting on.

@colbert2677 Thank you both for the help.

Man, Roblox should update their tutorials before someone goes insane.

1 Like