local Ups = {
Body = {
{"Still",
{"Still1",15,100,false,"Its a still part",
{DrainR = 1,Part = 2}},
.
.
.
}
Im trying to script a tech system by using a lot of tables. I usually iterate through them multiple times like
for j,l in pairs(Ups) do
for k,v in pairs(Ups[j]) do
.
.
.
--And so on. Its basically Inception...
It works fine (Maybe its inefficient, i wanted to avoid making scripts for each invidual button and manually placing the buttons) but i have a problem where i have to get the 'Body' from the table, but its not actually a member so i cant figure out how. Basicly what i want is for print(Ups[ j or 1]) to return "Body". Because i have a seperate table for the amounts of parts the player has on what they're building and what the limit for parts is. (Im using the same table for both Tech System and Building System)
local roverlimit = {
Wheels = 0,Internal = 0,External = 0,Body= 1}
local roveramount = {
Wheels = 0,Internal = 0,External = 0,Body = 0}
I need to get the Ups[j] so i can look at what they are in roverlimit and roveramount. So i can do roverlimit[Ups[j]]

8 comments
Also, as a bit of explanation on metatables, nested tables are not metatables. Metatables manipulate the behavior of specific Tables, nested Tables are simply members.
Thanks, i actually could have noticed that but i got confused with all the inception D: It still doesnt work for some reason. I changed print(Ups[j]) to print(j) and it gives an error on the Call Stack and takes me to that line....
Can you take an upload a screenshot of the error, or paste the text of it in its entirety to your question?
http://s9.postimg.org/72ppcpytb/Capture.jpg As you can see, it doesnt print either.
There's no error text in that screenshot. What's the Script Analysis look like?
There's nothing about it
It suddenly decided to work..
Well okay then.