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 |
|
|
|
| 23 Jun 2012 03:15 PM |
local string = "asdkljalkjsdfd"
print(#string) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 23 Jun 2012 03:22 PM |
| That's correct. You don't need a for statement. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|