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!
Courtesy of @Spjureeedd, all that had to be changed was "speaker" to "player.Name" in line 10 and "class" to "class.Value" in line 13!