generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Detecting Words in Message

Previous Thread :: Next Thread 
Drakonking10 is not online. Drakonking10
Joined: 01 Jul 2010
Total Posts: 216
25 Jun 2015 07:55 PM
The title may not be that clear but, I was wondering how you would check for certain words when someone talks.

I'm creating a custom chat GUI and I need to figure out how to do this so I can block at least some curse words.

I know of using msg == "Whatever" or msg:sub(1,5) == "Whatever" or even msg:sub(7) == "Whatever"

However, none of those will help me unless I know the specific location of the curse word, or if the curse word is the only thing they type.

Is there some way of finding a word in a message without knowing the location?

P.S.: Ive also heard of something like making the message go through Roblox's Filter System before posting it, but how would I do that?
Report Abuse
Ictis is not online. Ictis
Joined: 01 Sep 2011
Total Posts: 1216
25 Jun 2015 08:00 PM
http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#string.match
Report Abuse
CollabsAreSlow is not online. CollabsAreSlow
Joined: 18 Jun 2015
Total Posts: 28
25 Jun 2015 08:09 PM
or string.find
http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#string.match
Report Abuse
CollabsAreSlow is not online. CollabsAreSlow
Joined: 18 Jun 2015
Total Posts: 28
25 Jun 2015 08:10 PM
it's too late

http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#string.find
^ what i meant
Report Abuse
Drakonking10 is not online. Drakonking10
Joined: 01 Jul 2010
Total Posts: 216
25 Jun 2015 08:37 PM
I took a look at string.find and I managed to get it working, somewhat. I can't find multiple words, only 1.

string.find(box.Text:lower(), "curseWord")

That works, except of course curseWord would be replaced with an actual one. But, if I try doing something like this:

string.find(box.Text:lower(), "curseWord" or "anothercurseWord" or "anothercurseWord")

It wont work. So how can I search for multiple words.
Report Abuse
Ictis is not online. Ictis
Joined: 01 Sep 2011
Total Posts: 1216
25 Jun 2015 08:40 PM
cursewords = {"curse","bad phrase","awful"}

for _, curse in ipairs(cursewords) do
string.find(box.Text:lower(),curse)
end
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
25 Jun 2015 08:41 PM
box.Text:lower():find("CurseWord") or box.Text:lower():find("Abstract is dumb") then
Report Abuse
Drakonking10 is not online. Drakonking10
Joined: 01 Jul 2010
Total Posts: 216
25 Jun 2015 08:45 PM
Thanks guys, but yeah

Abstract is dum- *Banned*

:3
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
25 Jun 2015 08:47 PM
i know i've seen that wiki page with roblox's real filter which returns true or false try finding it in the wiki
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Jun 2015 09:38 PM
you're better off doing this:

http://wiki.roblox.com/index.php?title=FilterStringForPlayerAsync
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image