diff --git a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml index 8de9b7501..3fcc27552 100644 --- a/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml +++ b/content/en-us/reference/engine/classes/TextChatMessageProperties.yaml @@ -11,6 +11,22 @@ description: | defined in `Class.TextChatService.OnIncomingMessage` or `Class.TextChannel.OnIncomingMessage`. This can be used to customize the appearance of a message with [rich text](../../../ui/rich-text.md) tags. + + ```lua title='LocalScript - Retrieving and Using TextChatMessageProperties' + local TextChatService = game:GetService("TextChatService") + + TextChatService.OnIncomingMessage = function(message: TextChatMessage) + -- Derive chat message properties + local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties() + + -- Change color of message + properties.TextColor3 = Color3.fromRGB(255, 121, 121) + + -- Set chat window message properties + message.ChatWindowMessageProperties = properties + + return properties + end code_samples: [] inherits: - Instance