Player chat color

Ive been wanting to get a players’ chat color.
I cant find anything that works on the topic.
Ive searched high and low and couldnt find a woking solution.

My game has cross server chat and i was wanting to have the players in different servers to have their chat color, rather than white. Any help is appreciated!

4 Likes

You can use this plugin to customize your chat. You can change the color, font, size, anything.
https://www.roblox.com/library/6087306728/Bubble-Chat-Customizer

1 Like

That plugin throws an error, and it doesnt help me get the players chat color.

1 Like

Referencing the chat scripts, the player’s chat colour is calculated based on the characters of their name:

Chat.ChatModules.ExtraDataInitializer: Lines 86-117

local NAME_COLORS =
	{
		Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
		Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
		Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
		BrickColor.new("Bright violet").Color,
		BrickColor.new("Bright orange").Color,
		BrickColor.new("Bright yellow").Color,
		BrickColor.new("Light reddish violet").Color,
		BrickColor.new("Brick yellow").Color,
	}

	local function GetNameValue(pName)
		local value = 0
		for index = 1, #pName do
			local cValue = string.byte(string.sub(pName, index, index))
			local reverseIndex = #pName - index + 1
			if #pName%2 == 1 then
				reverseIndex = reverseIndex - 1
			end
			if reverseIndex%4 >= 2 then
				cValue = -cValue
			end
			value = value + cValue
		end
		return value
	end

	local color_offset = 0
	local function ComputeNameColor(pName)
		return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
	end

You can use the ComputeNameColor function

12 Likes

That worked, but how would i put it into a value? I just tried that and it didnt work.

As in, an intvalue? You can use a Color3Value

Okay, thank you for your help.