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: Sloppy text filter

Previous Thread :: Next Thread 
Smeers is not online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
13 Mar 2016 12:51 PM
This is very sloppy

function filterText(text)
local example1, x = text, nil

example1, x = example1:gsub("text3", " ")

local example2,z = example1, nil

example2, z = example2:gsub([[text2]],[[']])

local example,a = example2, nil

example, a = example:gsub([[text1]],[["]])
return example
end

plsfix?

is there a better way to do this?
Report Abuse
Smeers is not online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
13 Mar 2016 01:04 PM
k ill just use a for loop
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
13 Mar 2016 01:47 PM
local FilteredWords = {
["text3"] = " ",
["text2"] = "'",
["text1"] = "\"",
}

local function Filter(Text)
for Word,Replacement in next, FilteredWords do
Text = Text:gsub(Word,Replacement)
end
return Text
end


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