I’m having this weird issue where I can’t make rainbow chat tags work properly. I have forked the chat and stuff but for some reason other messages and wrong parts of the tag become rainbow.
isRainbow is a value passed to the function determining whether the tag should be rainbow or not.
if not isRainbow then
TagLabel.TextColor3 = tagColor
else
numberValue.Changed:Connect(function() -- numberValue is a number value that is constantly changing between 0 and 1
TagLabel.TextColor3 = Color3.fromHSV(numberValue.Value, 0.5, 1)
end)
end
(This might not be correct) When you get a random number maybe the number becomes the same number causing the color to be the same. For example, rolling a die would sometimes get you 2 numbers in a row meaning the same color 2 times in a row. Am I right?
tagColor is defined already inside of the default function, it shouldn’t be random. I also can’t really show as I was having the issue on mobile but the circled UI elements were also changing colours.
function methods:AddTagLabelToBaseMessage(BaseMessage, tagColor, formatTagText, isRainbow)
local tagNameSize = self:GetStringTextBounds(formatTagText, BaseMessage.Font, BaseMessage.TextSize)
local TagLabel = self:GetFromObjectPool("TextLabel")
TagLabel.Selectable = false
TagLabel.Size = UDim2.new(0, tagNameSize.X, 0, tagNameSize.Y)
TagLabel.Position = UDim2.new(0, 0, 0, 0)
TagLabel.BackgroundTransparency = 1
TagLabel.Font = BaseMessage.Font
TagLabel.TextSize = BaseMessage.TextSize
TagLabel.TextXAlignment = BaseMessage.TextXAlignment
TagLabel.TextYAlignment = BaseMessage.TextYAlignment
TagLabel.TextTransparency = BaseMessage.TextTransparency
TagLabel.TextStrokeTransparency = BaseMessage.TextStrokeTransparency
if not isRainbow then
TagLabel.TextColor3 = tagColor
else
numberValue.Changed:Connect(function()
TagLabel.TextColor3 = Color3.fromHSV(numberValue.Value, 0.5, 1)
end)
end
TagLabel.Text = formatTagText
TagLabel.Visible = true
TagLabel.Parent = BaseMessage
print(TagLabel:GetFullName(), isRainbow) -- true for some reason?
return TagLabel
end