this code should change color and do system message when fires remote event, but when I call function to do it color value is getting nil
script
local TextChatService = game:GetService("TextChatService")
local RBXGeneral = TextChatService.TextChannels.RBXGeneral
local Event = game.ReplicatedStorage:WaitForChild("BadgeTextAplication")
TextChatService.OnIncomingMessage = function(textChatMessage, color)
if textChatMessage.Metadata then
if color then
local textColor = color
print("Received color:", textColor)
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Text = string.format("<font color='%s'>%s</font>", textColor, textChatMessage.Text)
return overrideProperties
else
print("Color is nil")
return nil
end
else
-- do nothing
return nil
end
end
Event.OnClientEvent:Connect(function(plr, diff, color)
print("Received event:", plr, diff, color) -- Debugging line
local msg = "GG " .. tostring(plr.Name) .. ", pass " .. diff .. "!"
RBXGeneral:DisplaySystemMessage(msg, color)
print("Sent color:", color)
end)
output
16:55:52.321 Received event: zuner_floodescape Easy #406c4e - Client - ChatHandler:29
16:55:52.322 Color is nil - Client - ChatHandler:18
16:55:52.323 Sent color: #406c4e - Client - ChatHandler:35