Speaker (Speakername) already exists! [Error message]

Issue ━ Not 100% sure why this error occur, however I’d like to know what could cause this.
When attempting to add a new speaker, regardless of its name, it gives an error saying the speaker already exists.

What have you tried so far? ━ Renaming the speaker in case it was reserved for some reason.
I haven’t found any solutions yet.
After searching around, I see no information on this other than the error message.

Code

local StaffSpeaker = ChatService:AddSpeaker('Staff')
StaffSpeaker:SetExtraData('NameColor', Color3.fromRGB(255, 0, 0))
StaffSpeaker:SetExtraData('ChatColor', Color3.fromRGB(255, 170, 0))
StaffSpeaker:SetExtraData('Font', Enum.Font.SourceSansBold)
StaffSpeaker:JoinChannel('All')

Error message ━ ServerScriptService.ChatServiceRunner.ChatService:127: Speaker “Staff” already exists!

Replies for a possible solution is highly appreciated.

Your code is most likely running more than once, so after the first time, the “Staff” speaker has already been created. If you don’t want it to run more than once, you should debug that first. If you don’t care about it running more than once, you can swap out your first line for:

local speaker = ChatService:GetSpeaker("Staff") or ChatService:AddSpeaker("Staff")
1 Like

The solution was obvious when I think about it — but I appreciate the help regardless.

1 Like