Making a system message use a gradient in the new textchatservice

i’ve been trying to make a system message that includes a gradient for specific purposes using the new (yet not so new) textchatservice, though im really confused on how to achieve this, i have seen on the documentation that if you were to parent a uigradient to ChatWindowMessageProperties it would use the gradient, yet it doesn’t seem to work.

This is my current code

TextChatService.OnChatWindowAdded = function(message : TextChatMessage)
	print("hi")
	if message.Metadata == "gradient" then
		print("this is a gradient")

		local gradient = Instance.new("UIGradient")
		gradient.Color = holdGradient
		gradient.Parent = message.ChatWindowMessageProperties
	end
end

the ‘hi’ and ‘this is a gradient’ print so the code is running, yet the text doesnt receive a gradient., i do not know why

1 Like

bump because i still haven’t figured it out

This is a crafting ta- GET OUT
I think this post will explain it a bit better Channel Tabs & UI Gradient Now Available in TextChatService

I have tried this but it doesn’t seem to work either, I tried going back and applying it no matter if the message is supposed to have a gradient or not and it seems that it only applies the gradient to player names, is there a way to apply gradients to the text of the message itself? I assume this is what I’d need to add a gradient to the system message

what gradient are you applying?
What properties of it?

I’m copying a gradient’s properties over a remote event, though I don’t think that seems to be the issue as I applied the color manually instead of using a variable and there was no change
a roblox issue, I think

Bro just make gradient have a consistent color and apply it in chat message
You are overcolplicating testing

1 Like

I think you are misunderstanding this, I did do that for the sake of testing and there was no change, using remote events to forward the gradient color is only a final thing.

do print(typeof(holdGradient)) then ig

It is clear that the object is a gradient yet nothing shows up

1 Like

Code from: Channel Tabs & UI Gradient Now Available in TextChatService
What i think heppens is that you need to create properties instance ChatWindowConfiguration | Documentation - Roblox Creator Hub
each time becouse in your code you just parent gradients over and over to same instance.

TextChatService.OnChatWindowAdded = function(message: TextChatMessage)
	local properties = chatWindowConfiguration:DeriveNewMessageProperties()

	local textSource = message.TextSource
	if textSource then
		properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
		gradient:Clone().Parent = properties.PrefixTextProperties
	end

	return properties
end

Could you provide the code that handles the gradients application? You can’t expect us to magically be able to debug this.

This code in theory should work, though after a bit of digging through roblox’s coregui, my previous suspicions are correct

this would only edit the prefixtext which is only on messages sent by players, and there would have to be something completely separate to apply it on the bodytext which is what the system message exclusively uses

1 Like

That is the code that handles the gradient’s application? Unless I misunderstand what you mean

No its fine. I misread the code when I glanced over it.

Why aren’t you enabling the gradient? You do realise there is an Enabled property right? You can’t expect it to show if you’re not going to make it enabled.


The gradient doesn’t exist, it doesn’t get parented to the text which is why it doesn’t show up. I’m starting to believe I might need to do some really hacky solution in order to actually parent the gradient to the text because I don’t think there’s anything given by roblox

Why can’t you just make a module/func that sends a system message into chat with all modified properties and all you need to do is just parse relevant data? Would this not make it easier/applicable?