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 » Scripting Helpers
Home Search
 

Re: How do I store arrays in arrays in arrays and print it?

Previous Thread :: Next Thread 
Evetor is not online. Evetor
Joined: 04 Mar 2013
Total Posts: 4217
16 Apr 2014 04:33 PM
print(TMain[1][1][1])

Gives me an error.

Is this even possible?
Report Abuse
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
16 Apr 2014 04:37 PM
tbh, I don't know.
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
16 Apr 2014 04:37 PM
TMain = {1 = { 1 = {1 = "Hello"}}}

print(TMain[1][1][1])


My best guess is that the script is thinking that the [1] is what my example is up above, but it cannot find it. If you have something in dictionary format, like,

TMain = {["Hello"] = "Hi there";}

then you would use the following format for printing/calling in general:

print(TMain.Hello)
Report Abuse
Evetor is not online. Evetor
Joined: 04 Mar 2013
Total Posts: 4217
16 Apr 2014 04:50 PM
http://wiki.roblox.com/index.php?title=File:DataStoreDiagram.png&filetimestamp=20140213223139

Example on the ROBLOX wiki

First I have one main array.

The first layer (Hat classes) is a container for the second layer (Hats) which is a container for the third layer (Color) which are mesh templates (StringValues.)

If I can't make arrayception, then what can I do other than having 400 lines of "TopHat_StripedTopHat_Green = templateid"
Report Abuse
Evetor is not online. Evetor
Joined: 04 Mar 2013
Total Posts: 4217
16 Apr 2014 05:06 PM
.
Report Abuse
konichiwah1337 is not online. konichiwah1337
Joined: 16 Sep 2013
Total Posts: 1979
16 Apr 2014 05:17 PM
table1 = {"Stuff4Table1"}
table2 = {table1,"Stuff4Table2"}
table3 = {table1,table2,"Stuff4Table3"}


print(table.concat(table3))
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Apr 2014 06:25 PM
Yes it's possible.

local TMain={{{"Hi"}}}
print(TMain[1][1][1])
Report Abuse
Evetor is not online. Evetor
Joined: 04 Mar 2013
Total Posts: 4217
17 Apr 2014 04:57 AM
Thanks Cnt, it works!

local TMain={{{"Hi","Bye"}}}
print(TMain[1][1][2])
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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