Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 29 Jan 2012 01:24 PM |
Let's say I have an unidentified string that can either be "true" or "false". Is there anyway I can convert the first one to true, or the second one to false depending on what they are.
{ Learning normal Lua and RBX.Lua. } |
|
|
| Report Abuse |
|
|
Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 29 Jan 2012 01:25 PM |
?*
{ Learning normal Lua and RBX.Lua. } |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:27 PM |
| Wait..If the string can only be true or false, why not use the boolean in the first place? |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:34 PM |
| @dark, Good point. Just use it for that. |
|
|
| Report Abuse |
|
|
Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 29 Jan 2012 01:38 PM |
Because I'm getting the string true or false from something a player said.
{ Learning normal Lua and RBX.Lua. } |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 01:41 PM |
Not that hard, really.
if Text:lower() == "true" then return true else return false end
^ terrible example, but oh well.
bool = Text:lower() == "true" and true or false |
|
|
| Report Abuse |
|
|