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 » Scripting Helpers
Home Search
 

Re: Word Filtering

Previous Thread :: Next Thread 
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 06:53 PM
I have successfully made a Global Chat GUI but I'm looking to add a Word Filter to it to replace bad words and stuff.

For Example:
Someone includes the word "Mom" in their message.
> WORD FILTER RUNS <
The message now includes "Mum".
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
06 Aug 2012 06:56 PM
I don't think you can becaues you can't add bad words to scripts if I remember
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 06:56 PM
MESSAGE:gsub("Mom", "Mum");
http://wiki.roblox.com/index.php/Function_Dump/String_Manipulation#string.gsub


(OT: Love how you're changing American spelling to British ;))
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:09 PM
Thanks, XD.
I'm having "Mom" change to "Mum", "Dollars" to "Pounds", "Chips" to "Crisps", etc. It's gonna be so funny to see loads of confused Americans... XD
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:10 PM
Yes!
Win!
Yay!
^0^
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:11 PM
Well, maybe Chips isn't included in that because then if you want to talk about "Fries" in the UK, you'll put chips and it'll change to Crisps but other than that... XD
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:12 PM
Game Startup - Bottom Left Corner:
UK - Made In England
Proud Olympics Host

XD - This is how I'm setting my Welcome/Branding messages up now. As little notifications (similar to the ones on Sandbox).
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:14 PM
Anyway, I'll give it a go in a few hours after I've finished sleeping XD
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:15 PM
:D awesome

Btw I wonder if this would work:
local changes = {{"Mom", "Mum"}, {"Chips", "Crisps"}, --[[etc]]};
local message = --[[ what player chatted ]];
for _, c in pairs(changes) do
message = message:gsub(c[1], c[2]);
end
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:18 PM
Looks good. As I said, I'll give it a go later.

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three (01:16)
"Guess What? ... Chicken Butt!"
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:19 PM
Ok, I'm guessing you're in England and it's 1 am for you too? I should go to bed but I cba D:

Btw @your sig: Win. Absolute. Epic. Win. <3
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:21 PM
Yeah. XD
Going to bed after American Dad finishes... XD

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three (01:16)
"Guess What? ... Chicken Butt!"
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:22 PM
Ah, I don't have TV on - I'm listening to my favourite (Japanese) singer, Hatsune Miku ^0^!!!
Though at least I know I'm not the only one who times their bedtimes based on the BBC 3 schedule... XD
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:22 PM
*After the Second American Dad... XD

-- -- -- -- -- -- -- -- -- -- -- -- --
American Dad - BBC Three
"Mum! We were playing a game!"
"And I won..."
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:23 PM
Hatsune Miku is awesome. :D

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three (01:16)
"Guess What? ... Chicken Butt!"
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:24 PM
Even better!!!

Lol one of my favourite animated TV quotes would be Homer Simpson: "I didn't lie, I was writing fiction with my mouth", though some of my favourite all time quotes would be from Russell Howard and just a bit too rude for this site... ;) XD
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:25 PM
XD
I gave up with Russell Howard now, it just seems to compilations of his shows...
Homer: "I don't apologize! I'm sorry but that's just the way I am!".

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three (01:16)
"Guess What? ... Chicken Butt!"
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:28 PM
Goodnight. =D

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three (01:16)
"Guess What? ... Chicken Butt!"
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
06 Aug 2012 07:29 PM
Hmm yeah, that's cause they're not making a new series atm, but when they do, omg can't wait <3 He literally destroys my ability to control my laughter <3<3<3<3 (I'm a boy btw, just thought I'd say that ;))

Lol!!! Homer is so brilliant XD
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 07:49 PM
Yeah. I realised.
Ik you're a boy. I looked on the vocaloid group's wall.
XD
-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three
[Peter] "Guess What? ... Chicken Butt!"
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
07 Aug 2012 03:30 AM
Back to scripting...
It does translate now but if I type "Mom" on its own, it turns to "Mum". If I type (for example) "I want my Mom", it stays as that... D:

-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three
[Peter] "Guess What? ... Chicken Butt!"
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
07 Aug 2012 03:37 AM
Work with strings.
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
07 Aug 2012 03:44 AM
I am using strings...
-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three
[Peter] "Guess What? ... Chicken Butt!"
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
07 Aug 2012 03:53 AM
Okay. It works but I had to use message:lower(). It shows all messages in a lowercase form but it doesn't really matter.
-- -- -- -- -- -- -- -- -- -- -- -- --
Family Guy - BBC Three
[Peter] "Guess What? ... Chicken Butt!"
Report Abuse
Jlobblet is not online. Jlobblet
Joined: 05 Sep 2010
Total Posts: 587
07 Aug 2012 04:08 AM
One method:

toChange = {"mom","chips"}
changed = {"mum","crisps"}

game.Players.PlayerAdded:connect( function (NP)
NP.Chatted:connect( function (msg)
local message = msg:lower()
for x,v in pairs(tochange) do
string.gsub(message,toChange[x],changed[x])
end
end)
end)

Only edits, not returns, but it's a start.


~if not ok then return end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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