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
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
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
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.
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
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
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?