Hello! So, I getting this error after my script works and I type something in the chat.
here is the script:
local function OnIncomingMessage(msg)
local function Changed()
if stage.Value == 15 then
color = "#ffffff"
elseif stage.Value == 25 then
color = "#71d400"
elseif stage.Value == 40 then
color = "#4b974b"
else
color = "#ffffff"
end
end
Changed()
TextChatService.OnIncomingMessage = function(textChatMessage)
if system == true then
color = "#ffee00"
if textChatMessage.Metadata 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)
color = "#ffffff"
system = false
return overrideProperties
else
-- do nothing
return nil
end
else
if textChatMessage.Metadata then
local textColor = color
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Text = string.format("<font color='%s'>%s</font>", textColor, textChatMessage.Text)
color = "#ffffff"
return overrideProperties
else
-- do nothing
return nil
end
end
end
RBXGeneral:DisplaySystemMessage(msg)
end
how do I fix it?