Skip to content

Commit a29dbd3

Browse files
authored
Merge branch 'main' into patch-2
2 parents bee6564 + 4e58a26 commit a29dbd3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

content/en-us/reference/engine/classes/TextChatMessageProperties.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ description: |
1111
defined in `Class.TextChatService.OnIncomingMessage` or
1212
`Class.TextChannel.OnIncomingMessage`. This can be used to customize the
1313
appearance of a message with [rich text](../../../ui/rich-text.md) tags.
14+
15+
```lua title='LocalScript - Retrieving and Using TextChatMessageProperties'
16+
local TextChatService = game:GetService("TextChatService")
17+
18+
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
19+
-- Derive chat message properties
20+
local properties = TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties()
21+
22+
-- Change color of message
23+
properties.TextColor3 = Color3.fromRGB(255, 121, 121)
24+
25+
-- Set chat window message properties
26+
message.ChatWindowMessageProperties = properties
27+
28+
return properties
29+
end
1430
code_samples: []
1531
inherits:
1632
- Instance

0 commit comments

Comments
 (0)