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: How do you Sort a Array in numeric order?

Previous Thread :: Next Thread 
spongebobworldonline is not online. spongebobworldonline
Joined: 24 Sep 2008
Total Posts: 53
08 Apr 2012 08:45 PM
Hi, I need help for my game I need to sort a table of data (Array) and convert it to numeric order: eg:

TABLE = {3,5,2,6,1}

And when it is done It should be:

TABLE = {1,2,3,5,6}

If someone can give me a script or something it will be helpful!
Thanks,

-Sponge
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
08 Apr 2012 08:47 PM
table.sort

These trivial questions should be taken to Scripting Helpers, NOT to Scripters--Scripters is for people who are confident in knowing what they are talking about with scripting.

Also arrays are not the same thing as tables: call them tables.
Report Abuse
spongebobworldonline is not online. spongebobworldonline
Joined: 24 Sep 2008
Total Posts: 53
08 Apr 2012 09:09 PM
Oh sorry about posting it in the wrong place. I don't use the forums alot sorry about that.

Okay Ill try that, Thanks for your help :)
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
08 Apr 2012 10:12 PM
ipairs will do it too.
Report Abuse
meesterbean is not online. meesterbean
Joined: 27 Aug 2010
Total Posts: 1090
08 Apr 2012 11:29 PM
table.sort will do it.
I didn't know about ipairs.
Thanks Quenty :3
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
09 Apr 2012 12:24 AM
@Quenty; he means the values not (plural for of index[idencies?])
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
09 Apr 2012 12:28 AM
There should be an array library with an array.sort function.

Nah, kidding.
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