OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 18 Jan 2015 06:26 AM |
I need it to go from up to bottom in order
rolesets = { [8205624] = 9000, -- Major [8138517] = 7000, -- Captain [8138526] = 5000, -- Lieutenant [8138523] = 3250, -- Vanguard [8138532] = 1750, -- Sergeant [8138533] = 750, -- Corporal [8138534] = 250, -- Private First Class [8138535] = 0 -- Private }
for rank,pointamount in pairs(rolesets) do print(rank,pointamount) end
I have tested ipairs and next but they didnt print anything, as next errored.
In Wiki it uses in pairs which prints it in order.
what2do
|
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 18 Jan 2015 06:28 AM |
cant post output because roblox blocks it, prob cus its only numbers
but anyway it's nowhere near the right order |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 18 Jan 2015 07:27 AM |
| table.sort(rolesets, function(a,b) return a < b end) |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 18 Jan 2015 07:38 AM |
and how am I supposed to use it? if it was just a line after the dictionary it didnt work
also, is it putting the values in order or keys? values are the ones I want |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 18 Jan 2015 11:22 AM |
You can not control the order of a dictionary script Make a separate table of the keys in the dictionary and use that |
|
|
| Report Abuse |
|
|