Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] How would I change a player's chat's tags and chat colour mid-game?

I've edited the ExtraDataInitalizer module.

if pLaYeR:FindFirstChild("Playerstats") then
				local pLaYeRsTaTs = pLaYeR:FindFirstChild("Playerstats")
				if pLaYeRsTaTs:FindFirstChild("CurrentChatTag") and pLaYeRsTaTs:FindFirstChild("CurrentChatColour") then
					local CurrentChatTag = pLaYeRsTaTs:FindFirstChild("CurrentChatTag")
					local CurrentChatColour = pLaYeRsTaTs:FindFirstChild("CurrentChatColour")
					if CurrentChatTag.Value == nil or CurrentChatColour == nil then
						
					else
						local tags = {
							{
								TagText = tostring(CurrentChatTag.Value),
								TagColor = Color3.fromRGB(CurrentChatColour.Value)
							}
						}
						speaker:SetExtraData("Tags", tags)
						speaker:SetExtraData("NameColor", Color3.fromRGB(tags[2]))
						speaker:SetExtraData("ChatColor",  pLaYeR.TeamColor.Color)
					end
				end
			end

This sets the tags and colour when the player joins the game, but I would like the player to choose what tag and colour they want. The player would currently have to rejoin in order for the new tag to appear. How would I make it so that it updates in the server?

Edit: I just added a simple while loop and put all of it into a spawn function. Probably not the best way to do it, but it works. If there's a better way, let me know!

1 answer

✓ Accepted answer

You don't need to edit the modules. They are made in a way to be able to use them easily.

First you want to get the ChatService by requiring its module:

local ChatService = require(game:GetService("ServerScriptService").ChatServiceRunner.ChatService)

Then, get a chat speaker you want

local speaker = ChatService:GetSpeaker("LawIR") --must be a string

Finally, do whatever you want, such as set the extra data

speaker:SetExtraData("TextSize", 20)

You can find the documentation here

2 comments

0

Oh well. Thanks though. I'll remember this for furore projects.

0

Future*. The way I solved it wasn't too complicated anyway.

This discussion is preserved as it was. New answers, comments, and votes are closed.