-
What do you want to achieve? Ability to change your chat tag in real time.
-
What is the issue? The chat tag remains the same after changing the value.
Code:
local chatService = require(game:GetService('ServerScriptService'):WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
chatService.SpeakerAdded:Connect(function(name)
print(name)
local plr = game.Players:FindFirstChild(name)
local id = plr.UserId
local speaker = chatService:GetSpeaker(name)
if plr.CurrentTitle.Value == "" then
print(plr.Name.." has no title.")
else
print(plr.Name.." has the title "..plr.CurrentTitle.Value.." selected. Colour: "..tostring(game.ServerStorage.TitleColours[plr.CurrentTitle.Value].Value))
speaker:SetExtraData("Tags",{{TagText = plr.CurrentTitle.Value, TagColor = game.ServerStorage.TitleColours[plr.CurrentTitle.Value].Value}})
end
end)
Why doesn’t it update when a user says something after changing their chat tag? Can it only be set once? Or can I change it?
When you choose a chat tag, it changes the CurrentTitle value in the player.