Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 04 Jul 2014 08:12 PM |
I'm dealing with a table full of variables here.
table = {playervalue1, playervalue2, playervalue3}
How am I to sort these variables? |
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 04 Jul 2014 08:13 PM |
| To clarify, I mean from greatest to lowest in value. These are numbers here. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 08:16 PM |
if Table[1] <= Table[2] then --Code Here end
|
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 04 Jul 2014 08:22 PM |
| But is there a way to iterate through all the values? Because there's more than 2 values in this table- there's 8.. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 08:31 PM |
Use a for loop such as, for i = 1, #Table do end |
|
|
| Report Abuse |
|
|
| |
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 04 Jul 2014 08:45 PM |
It says "attempt to compare number with nil"
agilitytable = {P1AGL, P2AGL, P3AGL, P4AGL, E1AGL, E2AGL, E3EAGL, E4AGL}
table.sort(agilitytable) --errors on this line |
|
|
| Report Abuse |
|
|
vm9
|
  |
| Joined: 29 Nov 2007 |
| Total Posts: 347 |
|
|
| 04 Jul 2014 08:52 PM |
| In your table, are you setting the values in the table with variables? If yes, then check to see if all of the variables actually store a value. That's about all I can help with. |
|
|
| Report Abuse |
|
|