hi, So basically I am creating my own roleplay game and I want anomaly actors to have a different font when chatting. I am not sure how do I do that and my research on forums was not really efficient so I ended up with failing at resolving my issue. Thats why I am here.
My goal is to have a script, preferably in server script storage to check each time player character spawns what team the player is on, if player is on Anomaly Actor team the font should be Enum.Font.Antique
Can someone provide a code with an explanation attached to it or a detailed instruction how can I do it?
For the former, you need to create a TextChatService.OnIncomingMessage callback then create rich text tags for the PrefixText and/or Text properties of your TextChatMessageProperties
If you’re using legacy chat, use speaker:SetExtraData('Font', Enum.Font.Antique)
I tried using the following code in Starter Player however It did not do what it was supposed to.
local players = game:GetService("Players")
local player = players.LocalPlayer
local Teams = game:GetService("Teams")
local BubbleChatConfiguration = game:GetService("TextChatService").BubbleChatConfiguration
player.Team.Changed:Connect(function()
if player.Team == Teams["Anomaly Actor"] then
BubbleChatConfiguration.BackgroundColor3 = Color3.new(0.415686, 0.403922, 0.278431)
BubbleChatConfiguration.TextColor3 = Color3.new(0, 0, 0)
BubbleChatConfiguration.Font = Enum.Font.Antique
end
end)```
After adding prints I came to conclusion that the .Changed event is not even fireing
local players = game:GetService("Players")
local player = players.LocalPlayer
local Teams = game:GetService("Teams")
local BubbleChatConfiguration = game:GetService("TextChatService").BubbleChatConfiguration
player.Team.Changed:Connect(function()
if player.Team == Teams["Anomaly Actor"] then
print("Player Is An Actor")
BubbleChatConfiguration.BackgroundColor3 = Color3.new(0.415686, 0.403922, 0.278431)
BubbleChatConfiguration.TextColor3 = Color3.new(0, 0, 0)
BubbleChatConfiguration.Font = Enum.Font.Antique
else
print("Player is not an actor :(")
end
end)
I changed team twice and it did not print anything from mentioned script