So, i want to testing TextChatService, i find out that some text chat like RBXSystem have a different color than the RBXGeneral, i take a conclusion, that textchatservice can use color, i want to ask, how to use / change color in textchat ?
and i want ask too, how to send chat for all player in server with server script?
-
It’s RichText
-
You can’t send chat to all players, you displayed it throught using RemoteEvent or different Remote
Roblox Documentation Got you all things (or some) you need to know about it
Thanks for the information, after i searching in the documentation, i found this
local TextChatService = game:GetService("TextChatService")
local generalChannel: TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral
generalChannel:DisplaySystemMessage("This is an error!", "Game.Error.Generic")
generalChannel:DisplaySystemMessage("Could not find save data!", "Game.Error.SaveDataNotFound")
generalChannel:DisplaySystemMessage("You won the game!", "Game.Info.Win")
generalChannel:DisplaySystemMessage("You lost the game!", "Game.Info.Lose")
generalChannel.OnIncomingMessage = function(message: TextChatMessage)
if string.find(message.Metadata, "Error") then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.TextColor = Color3.fromRGB(255, 0, 0)
return overrideProperties
elseif string.find(message.Metadata, "Info") then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.TextColor = Color3.fromRGB(0, 255, 150)
return overrideProperties
end
return nil
end
maybe this useful for someone who find it useful too.
source: TextChatMessage | Dokumentasi - Pusat Kreator Roblox
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.