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: What could I use to test amount of letters.

Previous Thread :: Next Thread 
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
23 Jun 2012 03:14 PM
This would really help me out. how could I test how much digits or letters somethings text or value has with a script?
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Jun 2012 03:15 PM
local string = "asdkljalkjsdfd"

print(#string)
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
23 Jun 2012 03:18 PM
So if I used an if statement what would it look like, maybe like this?

local string = script.Parent.Text
if #string > 10 then



or would I need a for statement?
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Jun 2012 03:22 PM
That's correct. You don't need a for statement.
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
23 Jun 2012 03:36 PM
Then why doesnt this work?

function onChanged(Value)
local string = script.StringValue.Value
if #string > 5 then
script.Value.Value = "Ovar five"
elseif #string <= 5 then
script.Value.Value = "Less den six"
end
end
script.StringValue.Changed:connect(onChanged)
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
23 Jun 2012 03:37 PM
Oops, my bad, I messed up, thank You for your time.
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