I am receiving a "tables cannot be cyclic" error from line #10 of the following script:
local ServerScriptService = game:GetService("ServerScriptService")
local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
local ChatService = require(ChatServiceRunner.ChatService)
local giveTag = game.ReplicatedStorage.GiveTag
giveTag.OnServerEvent:Connect(function(player)
local speaker = ChatService:GetSpeaker(player.Name)
local class = game.ReplicatedStorage:WaitForChild(speaker):WaitForChild("Class")
local DefaultTags = {
{TagText = class, TagColor = Color3.new(1,0,0)},
}
if speaker and speaker:GetPlayer() then
speaker:SetExtraData("Tags", DefaultTags)
end
end)
The "class value" that line #10 is looking for is a StringValue that is generated by the script below; players' "class value" exists within its own individual folder sharing the same name as its designated player.
game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder")
folder.Parent = game.ReplicatedStorage
folder.Name = player.Name
local Class = Instance.new("StringValue", folder)
Class.Name = "Class"
Class.Value = "No class"
end)
If additional clarification is needed, please don't hesitate to tell me. All help is appreciated!

9 comments
Try doing "speaker.Name" or instead "player.Name"
Sadly I recieved "Chat.ClientChatModules.MessageCreatorModules.DefaultChatMessage:52: invalid argument #2 to 'format' (string expected, got Instance)" from using "speaker.Name" and "player.Name"
On line 10 it should work with player.Name, since you're using it in WaitForChild
Whenever I send a chat message I still recieve "Chat.ClientChatModules.MessageCreatorModules.DefaultChatMessage:52: invalid argument #2 to 'format' (string expected, got Instance)," could it be because I'm using studio instead of testing it out in a live game?
I actually don't know, which line in the script you included sends this error?
Presumably line #10, however, the error I'm receiving now comes from chat module scripts because I think it may be indentifying something incorrectly and consequencely not letting me send a message.
When you get the error you also get a "backtrace" so you see which line in the first script has the error. I would actually guess it's line 16 but I don't know
that’s strange. as far as I know, waitforchild(player.Name) is definitely a string. it sounds like you might be changing the wrong line. have you changed line 10 “speaker” to “player.Name”? he is correct that it’s probably line 16 (a new problem).
I found the problem, player.Name worked, the miscommunication came from line 13 which asked for "class" when it should have been asking for "class.Value." Thank you so much for your help!