generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: order of table

Previous Thread :: Next Thread 
OzzyFin is not online. 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 is not online. 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 is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
18 Jan 2015 06:45 AM
table.sort(rolesets)
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
18 Jan 2015 07:24 AM
still the same result
Report Abuse
eLunate is not online. 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 is not online. 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 is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
18 Jan 2015 11:20 AM
hello there
Report Abuse
128GB is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image