|
| 18 Nov 2015 02:06 PM |
Why doesn't this work? Between 2 and 3 are numbers.
if string.sub(itemslot.AmountNumber.Text, 2, 3) > 1 then --code end |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Nov 2015 02:17 PM |
| Output says that I can't compare string and number, so how do I make that string to a number? |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2015 02:18 PM |
I'm not very good when it comes to things like this..but try the '#'
if string.sub(#itemslot.AmountNumber.Text, 2, 3) > 1 then --code end
No idea if it would work.
http://www.roblox.com/Lots-item?id=307049082http://www.roblox.com/Of-item?id=307039670http://www.roblox.com/Violence-item?id=307039720 http://www.roblox.com/--item?id=316030220 | You're going to have a bad time. |
|
|
| Report Abuse |
|
|
BogyMac
|
  |
| Joined: 04 Nov 2011 |
| Total Posts: 823 |
|
|
| 18 Nov 2015 02:21 PM |
Try:
if tonumber(string.sub(itemslot.AmountNumber.Text,2,3)) > 1 then --code end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 18 Nov 2015 02:30 PM |
| @cntkillme can you write the right command? |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Nov 2015 02:50 PM |
@cntkillme thank you, but I found another problem. Why won't this work?
string.sub(slots[a].Name, 1, 5) == "CSlot"
The full name is CSlot1. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 18 Nov 2015 02:51 PM |
| It will work, you're just doing something wrong. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2015 02:56 PM |
| @cntkillme It just doesn't find a ImageButton that starts from "CSlot" and I have 4 items that start from "CSlot" in the same Parent. There is no error in output. |
|
|
| Report Abuse |
|
|