You can write your topic however you want, but you need to answer these questions:
**i am trying to make a textchatservice system message with custom font and color
**it sends this blob of text
**i have tried to look through everything, including devforum
-- serverscript
-- game.Players.PlayerAdded:Connect(function(player)
local color = Color3.fromRGB(31, 1, 255)
game.ReplicatedStorage.SystemMessage:FireAllClients(string.format(`<font color=\"#{color:ToHex()}" <font size = 18> "Welcome, "..player.DisplayName.."!"}</font></font>`))
end)
-- localscript
game.ReplicatedStorage:WaitForChild("SystemMessage").OnClientEvent:Connect(function(message)
game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(message)
end)
game:GetService("TextChatService").OnIncomingMessage = function(textChatMessage)
local textChannel = textChatMessage.TextChannel
if textChannel and textChannel.Name == "RBXSystem" then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Message = string.format("<font color='#FF0000'>%s</font>", textChatMessage.Text)
return overrideProperties
else
return nil
end
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Here’s the corrected version of both the server script and the local script:
Server Script
game.Players.PlayerAdded:Connect(function(player)
local color = Color3.fromRGB(31, 1, 255)
local hexColor = color:ToHex()
local message = string.format("<font color='#%s' size='18'>Welcome, %s!</font>", hexColor, player.DisplayName)
game.ReplicatedStorage.SystemMessage:FireAllClients(message)
end)
Local Script
game.ReplicatedStorage:WaitForChild("SystemMessage").OnClientEvent:Connect(function(message)
game:GetService("TextChatService").TextChannels.RBXGeneral:DisplaySystemMessage(message)
end)
game:GetService("TextChatService").OnIncomingMessage = function(textChatMessage)
local textChannel = textChatMessage.TextChannel
if textChannel and textChannel.Name == "RBXGeneral" then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Message = string.format("<font color='#FF0000'>%s</font>", textChatMessage.Text)
return overrideProperties
else
return nil
end
end
also it doesnt work it just says “Error occurred while calling TextChatService.OnIncomingMessage: Message is not a valid member of TextChatMessageProperties “Instance””