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: TRIED EVERYTHING. [Name Changer Script]

Previous Thread :: Next Thread 
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
23 Jun 2017 11:22 PM
Okay so don't get the wrong Idea.

I made a name changer. Theres a text label above a players head and you can make it anything you want. The problem is "you can make it ANYTHING you want"

How would disable some stuff for instance:
Spaces
Text limit(Name can't be longer than 12)
No cuss words(preferably)

Please help I don't know what to do.
Report Abuse
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
23 Jun 2017 11:32 PM
bump
Report Abuse
G_FX is not online. G_FX
Joined: 29 Jan 2011
Total Posts: 132
23 Jun 2017 11:34 PM
###########################################################################
Report Abuse
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
23 Jun 2017 11:35 PM
tags,
Report Abuse
G_FX is not online. G_FX
Joined: 29 Jan 2011
Total Posts: 132
23 Jun 2017 11:37 PM
I linked a wiki page.
I'd look into "String Manipulation" on the wiki
Report Abuse
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
23 Jun 2017 11:40 PM
Will do. thanks for instant reply bro
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
24 Jun 2017 12:22 AM
wiki.roblox.com/index.php?title=String_pattern#Character_Classes

textbox:GetPropertyChangedSignal("Text"):connect(function() --// is this how you do that?
--// check for white space
--// check length of textbox.Text with # operator
end)

textbox.FocusLost:connect(function(enterpressed)
if enterpressed then
--// remote function to use FilterStringAsync on it (filters it for cuss words n stuff)
end
end)


Report Abuse
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
24 Jun 2017 10:26 AM
Can you explain more? I looked at string pattern and found

"%s A whitespace character"
I'm guessing thats spaces between text? If so how would I remove those 'whitespace characters'
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
24 Jun 2017 02:13 PM
I take it you've never worked with string manipulation before

local text = textbox.Text
if text:match("%s") then
text = text:sub(1, #text-1)
end

with the code i had before


Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
24 Jun 2017 02:35 PM
local function nowhitespacezandcharlimit(t,l)
for x=1,string.len(t)do
if t:sub(x,x)==' 'or x==l then
return(t:sub(1,x-1))
end
end
end


local text="Hello World"
local newtext=nowhitespacezandcharlimit(text,12--[[max lenght(name can't be longer than 12)]])
print(newtext)-- prints "Hello"

local text2="MyNameIsTooLong"
newtext=nowhitespacezandcharlimit(text2,12)

print(newtext)-- prints "MyNameIsToo"
Report Abuse
NostalgicClak is not online. NostalgicClak
Joined: 18 Nov 2014
Total Posts: 400
28 Jun 2017 03:27 PM
huh
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