I made a system, if a command is written into the chat, the message is painted in a certain color, but I have almost two of the same identical scripts, only the command is different, but they do not work. Only /me works, I don’t understand why.
TextChatService.OnIncomingMessage = function(textChatMessage: TextChatMessage)
if not textChatMessage.TextChannel then print("Ф") return nil end
if string.sub(textChatMessage.Text, 1, 3) == "/do" then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Text = string.format("<font color='#7726b5'>%s</font>", string.sub(textChatMessage.Text, 5))
return overrideProperties
end
return nil
end
TextChatService.OnIncomingMessage = function(textChatMessage)
if not textChatMessage.TextChannel then print("Ф") return nil end
if string.sub(textChatMessage.Text, 1, 3) == "/me" then
local overrideProperties = Instance.new("TextChatMessageProperties")
overrideProperties.Text = string.format("<font color='#7726b5'>%s</font>", string.sub(textChatMessage.Text, 5))
return overrideProperties
end
return nil
end