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
 

Next subject in table?

Previous Thread :: Next Thread 
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
01 Jan 2015 10:38 AM
Is it possible to read data from the next subject in a table, here's my example:

local songs = {
One = {196293583, 20},
Two = {184377620, 20},
}

I setup a music player and it runs smooth, but 3/4 of the way through the song I want to make a textlabel appear saying the next song, problem is I can't figure out how to get the next subject in the table, I tried to add 1 to the current data (stupid idea) thinking it'd work but it didn't, help?
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
01 Jan 2015 10:38 AM
b
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
01 Jan 2015 10:39 AM
dont use a dictionary - use a normal array so you can index by a number

local songs = {
{196293583, 20},
{184377620, 20},
}


songs[1]
songs[2]
...
songs[n]
Report Abuse
HalfCircuit is not online. HalfCircuit
Joined: 20 Apr 2011
Total Posts: 5018
01 Jan 2015 10:39 AM
uh, subject?
what's a subject?

are you referring to the key or the value, or the pair together?
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
01 Jan 2015 10:49 AM
I don't understand this, I just can't make it work..
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
01 Jan 2015 10:50 AM
b1
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
01 Jan 2015 10:52 AM
b2
Report Abuse
HalfCircuit is not online. HalfCircuit
Joined: 20 Apr 2011
Total Posts: 5018
01 Jan 2015 10:54 AM
what is a subject??
Report Abuse
Rellica is not online. Rellica
Joined: 11 May 2013
Total Posts: 955
13 Jan 2015 09:30 AM
b1
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Jan 2015 09:31 AM
"dont use a dictionary - use a normal array so you can index by a number

local songs = {
{196293583, 20},
{184377620, 20},
}


songs[1]
songs[2]
...
songs[n]"
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Jan 2015 09:41 AM
Look up on LinkedLists, you can implement number indexing on a non-array taxable, but it's useless.
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