# Roblox, custom chat filter

So, I would like to add my own chat filter to my game, how would I do this?

eg: Player says: "DIE" Goes through chat filter and comes out as: "###" or any other string I specify.

• How have you set up your chat so far? – DMGregory Dec 10 '18 at 0:43
• I haven't done anything so far, I don't know where ro start. – W0LFB0MB Dec 10 '18 at 1:32
• You should start by creating a Roblox game. You'll need to learn enough Lua scripting to modify the Lua Chat System. You'll be looking to add a Filter Function that replaces words in each message's content using string.gsub. Maybe this helps you get started? I would recommend for you to ask questions about the specific thing you're stuck at right now, so answers can get straight to the point. – Anko Dec 12 '18 at 12:45
• @Anko that looks like it could make a pretty good answer, with just a little more detail about how to set up this filter function. – DMGregory Dec 13 '18 at 15:39

if(string.match(message, "DIE")) then