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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:29 PM
For an example:

Tab = {Tab1 = {Tab2 = {}}}

Now say I only have access to Tab2, how would I access Tab1 and Tab2, since I do not know of something similar to "Part.Parent"?

Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
19 Aug 2011 03:30 PM
tab1 = {tab2 = {tab3 = {"LOLWUT"}}}

print(tab1.tab2.tab3[1])
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:30 PM
[ Content Deleted ]
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:31 PM
@Dekkonot

You have only access to tab3, so to access tab2 or tab1 you will need something like:

Tab2 = Tab3.Parent
Tab1 = Tab2.Parent

However... Tables do not have this parent property?
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:33 PM
[ Content Deleted ]
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:34 PM
"Why are you even asking this?"

Answer my question first please.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:35 PM
[ Content Deleted ]
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
19 Aug 2011 03:35 PM
tab1 = {tab2 = {Parent = tab1, tab3 = {Parent = tab2, lol = "LOLWUT"}}, lolwut = "I win"}

print(tab3.Parent.Parent.lolwut)
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:38 PM
Ok... Let me explain this a bit more. Someone gave me a variable called "Tab3", and he said that this variable is a table.

Now he told me - find out if this variable is inside a table or not. How would I figure that out?
Report Abuse
GollyGreg is online. GollyGreg
Joined: 22 May 2008
Total Posts: 21835
19 Aug 2011 03:38 PM
local stuff = {
My_stuff = {"StringA",2,"blah blah"},
His_stuff = {"StringB",2,"blah blah"},
Your_mothers_stuff = {"StringC",7,"blah blah"},
}

You can call it by doing

stuff["My_stuff"][1]
or
stuff.My_stuff[1]

You can even just store variables instead of entire tables. Like:

local stuff = {
JacobsFavColor = "Red"
StevesFavColor = "Blue"
}
print(stuff["JacobsFavColor"])
>Red
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
19 Aug 2011 03:38 PM
Look at the script. >:3
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:40 PM
[ Content Deleted ]
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:42 PM
@Dekkonot

Yes I know. However, this person created a table which looks like this:

Tab1 = {Tab2 = {Tab3 = {}}}

He didn't show me that ^, all he said: "There is a variable called "Tab3" which is a table, find out if it is inside a table or not."

I am oblivious to the fact that there is Tab2 and Tab1.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:43 PM
[ Content Deleted ]
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:43 PM
[ Content Deleted ]
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
19 Aug 2011 03:44 PM
[ Content Deleted ]
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
19 Aug 2011 03:44 PM
No way that has been documented. Figure it out, then tell me so I look smart.
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
19 Aug 2011 03:46 PM
[ Content Deleted ]
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:47 PM
"No way that has been documented. "

It hasn't been documented. That is why I am asking if some "Lua genius" can give me an answer other than "Impossible".

Also "he" is just a hypothetical character I made to explain myself.
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
19 Aug 2011 03:48 PM
Table = {Taco = {}}
is the same as
Table = {}
Table.Taco = {}

So you can
print(Table.Taco)
or
print(Table["Taco"])
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
19 Aug 2011 03:48 PM
Can you use table:getChildren()
Report Abuse
bombpaw is not online. bombpaw
Joined: 15 Mar 2009
Total Posts: 3484
19 Aug 2011 03:48 PM
"Ok... Let me explain this a bit more. Someone gave me a variable called "Tab3", and he said that this variable is a table.

Now he told me - find out if this variable is inside a table or not. How would I figure that out?"

He told you it was in a table..... Simple answer :P

-I got bomb in my.... Paw?
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:49 PM
@Oysi

HE DIDN'T SHOW ME HOW HE MADE THE TABLE!!!

All I know is that there is a variable called: Tab3

And he asked, find a way to figure out if Tab3 is inside a table or not. If it is inside a table show him how I worked it out, and if it isn't - give him a reason why.

Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
19 Aug 2011 03:50 PM
Oh I see what OP means....

Table = {}
Table.Taco = {}
Table.Taco.Parent = Table

Just do that.
print(Table.Taco.Parent == Table) ==> true
Report Abuse
nightname is not online. nightname
Joined: 10 Jun 2008
Total Posts: 8960
19 Aug 2011 03:50 PM
@Capictator

The problem is I cannot do:

Table.taco

since I do not know if taco is inside a table nor do I know the table's name. Iy-ya-yah...
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