I know one way you can do is create a custom text event as such, but this method has a drawback: this only works for people with the script installed, those who don't will still see the bad words being said.
on ^*:TEXT:*:#: {
var %x = word1 word2 word3 word4 word5 word6 word7
var %y = $numtok(%x,32)
while (%y) {
if ($gettok(%x,%y,32) isin $strip($1-)) {
echo -mt # < $+ $nick($chan,$nick).pnick $+ > <censored>
haltdef
}
dec %y
}
}
Plus this will block the whole sentence instead of masking the bad words themselves. So overall, it's not a good approach.
good