I tried this out:
local CHAT_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
function ComputeChatColor(pName)
print (CHAT_COLORS[(GetNameValue(pName) % #CHAT_COLORS) + 1])
return CHAT_COLORS[(GetNameValue(pName) % #CHAT_COLORS) + 1]
end
local ChatService = game:GetService("Chat")
game.ReplicatedStorage.ChatService.OnServerEvent:connect(function(Player, ChatMsg)
local ChatColor = ComputeChatColor(Player.Name)
local pName = Player.Name
local FilteredMessage = ChatService:FilterStringForBroadcast(ChatMsg, Player)
ChatService:Chat ( Player.Character, FilteredMessage, Enum.ChatColor.Blue )
local v=Player.OtherStats.ChatPrefix.Value.." "..Player.OtherStats.ChatLvl.Value.." "..Player.Name..": "..FilteredMessage
game.ReplicatedStorage.ChatService:FireAllClients(v, ChatColor)
end)
but its giving value like 0.643636, 0.643234 0.5321214 and i don't know where is the problem Sthe value are too little so it assume its black
