Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I change certain words that the player chatted?

Asked by 3 years ago

Hello! My question in the title may be a little confusing, the thing that I want to do is so that some words when chatted will change into other words (etc. when a player says "noob" in a sentence, it will change to "pro", if the player types "you're a noob", it will become you're a pro.

Is there a way to do that? If so, how? Are there any good websites I can refer to? I can't seem to find a good website explaining how to do these.

Also, the player could just type "N0ob", changing one of the O to a zero, is there a way to change that to another word as well? there are just too many combanations and i don't have a slightest idea of how to do that.

Please help! All help is appreciated! Thanks for your time.

Disclaimer: i'm not asking for scripts, but sources instead

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Lua's ChatSystem's ChatService and its RegisterFilterMessageFunction function.

Ad
Log in to vote
0
Answered by 3 years ago

Gather the message that the player sent and make a table with all the possible combinations for the word you don't want said. When the player chats, check if it is that specific word using in pairs and if it is the message, set the string to another set string such as: '#####'. You could also create a swear bin and gather the amount of letters in the word with table.concat() and replace them with hashtags. https://developer.roblox.com/en-us/api-reference/lua-docs/string

Answer this question