lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 26 Dec 2013 02:25 PM |
So say I had a model with parts names
P1, P2, P3, P4, P5.... etc
How would I index the integer (the "1" in P1) via script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Dec 2013 02:27 PM |
Just use basic string patterns or if it's all going to start with P, just do: blah:sub(2) |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 26 Dec 2013 02:35 PM |
string:sub(int) or string.sub(int)? I'm guessing the first returns it but the latter changes it? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Dec 2013 02:37 PM |
No, none of them change it, to change it you do.
int = int:sub(etc) or
int = string.sub(int, etc) |
|
|
| Report Abuse |
|
|