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: I want to Filter a TextBox

Previous Thread :: Next Thread 
HatLicense is not online. HatLicense
Joined: 16 Mar 2015
Total Posts: 330
26 Jan 2016 06:37 PM
I'm allowing the Player to set a RolePlay name, and I want to check this TextBox for words I restrict to be within the Name, I've searched up filterstringforplayer but I'm not really understand it. Could someone expand on the Topic?
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
26 Jan 2016 06:38 PM
local rolePlayName = game:GetService("Chat"):FilterStringForPlayerAsync(PLAYER, TEXTBOX.Text);
Report Abuse
HatLicense is not online. HatLicense
Joined: 16 Mar 2015
Total Posts: 330
26 Jan 2016 06:40 PM
What is that doing?
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
26 Jan 2016 06:41 PM
Actually, this might be better:

--define player, textbox
local chat = game:GetService("Chat")

local rolePlayName;
repeat rolePlayName = textbox.Text
until rolePlayName == chat:FilterStringForPlayerAsync(player, rolePlayName)


That should keep asking for it until they write an appropriate name.
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
26 Jan 2016 06:42 PM
game:GetService("Chat") finds game.Chat
:FilterStringForPlayerAsync(PLAYER, TEXTBOX.Text) calls the method FilterString..., passing in the player and the text and returning a scrubbed string.
Report Abuse
HatLicense is not online. HatLicense
Joined: 16 Mar 2015
Total Posts: 330
26 Jan 2016 06:47 PM
I'd like it to display a warning that I have made,

would this work?

local rolePlayName = script.Parent.Parent["Roleplay Name"].TextBox.Text
if rolePlayName ~= chat:FilterStringForPlayerAsync(plr, rolePlayName) then
-- Display Alert
end

Sorry if its completely off.
Report Abuse
HatLicense is not online. HatLicense
Joined: 16 Mar 2015
Total Posts: 330
26 Jan 2016 07:20 PM
Bump
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