I’m creating a custom chat filter but I need to make the string lower case if I want to filter the message, is there any way around this? Here’s my code:
I’m using the lua chat system, which you can see here: Customizing In-Experience Text Chat | Documentation - Roblox Creator Hub
local words = {
'hi'
}
local tag = '#'
function Run(ChatService)
local function filter(speaker, messageObject, channelName)
local msg = messageObject.Message:lower()
for _, word in pairs(words) do
local filtered = msg:gsub(word, tag:rep(#word))
messageObject.Message = filtered
end
end
ChatService:RegisterFilterMessageFunction('CustomChatFilter', filter)
end
return Run