:JoinChannel won't work for ChatService

Hello everyone!

I’ve recently been having issues with the Lua Chat System.
I’m trying to make it so a player is added to a channel.

Here’s my code:

local channel = ChatService:GetChannel("MyChannelName") -- The channel
local speaker = ChatService:GetSpeaker("MeaxisDev") -- The player

speaker:JoinChannel(channel)

The code returns the following error:
ServerScriptService.ChatServiceRunner.Speaker:107: attempt to call a nil value

I’ve tried to print both speaker and channel, both return something in the Output, so they aren’t nil.
Does anyone have an idea of what I did wrong?

Thanks in advance!

JoinChannel takes the name of the channel as a string, not the channel object itself.

1 Like