|
| 18 Jun 2016 06:13 AM |
How could i store a string value to an int value?
Like.. when someone writes a number and clicks the button.. it would copy the string from the textbox and then the string would be copied to an int value.
HELP?!?
#code Tags --- My Robux status - R$103 Please play my game GTA - BLOXLAND! |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Jun 2016 06:16 AM |
You would use tonumber()
So, IntValue.Value = tonumber(TextBox.Text) |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Jun 2016 06:18 AM |
| but a Textbox-to-number setup is not safe, because they could input letters and symbols, the like of which you cannot convert with tonumber() ... X) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 06:18 AM |
Thanks! I'll try to disable letters!
#code Tags --- My Robux status - R$103 Please play my game LOTTERY PLAZA |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Jun 2016 06:24 AM |
| You can use string manipulation and just remove anything besides numbers when they enter them in. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Jun 2016 06:24 AM |
| But tonumber will remove them so you don't have to unless you want it to look nice. |
|
|
| Report Abuse |
|
|