enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:18 AM |
| I want to start with the last and end with the first. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:19 AM |
| We just switch it around right? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 10:28 AM |
It doesn't do it in any specific order, is it a item? Add it to the list, thats all But if you really need it
InverseChildren(Object) ChildTable = {} for Add = #Object:GetChildren(), 1, -1 do pcall(function() table.insert(ChildTable, Object:GetChildren()[Add]) end) end return ChildTable end |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:36 AM |
I wouldn't like to use tables would for I=#stuff,1,-1 do print(stuff[I]) end work? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 10:41 AM |
"Don't want to use tables" You know GetChildren is a table right -.-
for a = 1,#Workspace:GetChildren() do print(Workspace:GetChildren()[a].Name) end
tab = {Workspace.Part, Workspace.Base, Workspace.Player1} for a = 1,#tab do print(tab[a]) end |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:43 AM |
| yes it is and I only use it to get the things. I just wanna get the list from the bottom up. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 10:46 AM |
Thats what I gave you.
for a = 1,#InverseChildren(Workspace) do print(InverseChildren(Workspace)[a]) end |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 10:47 AM |
So you want a table with something like this: { Part5, Part4, Part3, Part2, Part1 }
Instead of: { Part1, Part2, etc }
? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:50 AM |
Yes little , and there should be a way to do this with the table of the getchildren... |
|
|
| Report Abuse |
|
|
Zomebody
|
  |
| Joined: 01 Jun 2010 |
| Total Posts: 789 |
|
|
| 21 Oct 2013 10:51 AM |
NewTable = game.workspace:GetChildren() SaveTable = {}
for i = #NewTable, 1, -1 do SaveTable[#SaveTable+1] = NewTable[i] end
NewTable = SaveTable SaveTable = nil
This should turn around the table, which was returned by the :GetChildren() method. Is this what you are looking for? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:57 AM |
| That doesn't turn it around and why can't we just do it with the get children table? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 10:59 AM |
| its still printing the 3,4,1,2. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 11:03 AM |
| Whats wrong with what I said? Its exactly what you asked for -.- |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
| |
|
|
| 21 Oct 2013 11:10 AM |
There might be a error or typo I made it on a iphone it should be pretty easy to fix though (Forgetting an end or something) But the idea of it works fine |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 11:34 AM |
| u don't understand that it really just doesn't work if it did. It would work with the GetChildren Table. |
|
|
| Report Abuse |
|
|
| |
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 11:42 AM |
| Get Children itself isn't listing in order so that could be the problem. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 12:17 PM |
| Are you trying to get values out of a table? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 12:18 PM |
| Get the Values in the correct order. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2013 12:22 PM |
Lmfao "GetChildren Backwards" xd sounds wrong |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
| |
|
| |
|
|
| 21 Oct 2013 12:39 PM |
What I gave you works fine (With one typo, forgot to say "function") I slightly edited it to run on my phone (Im still on my iPhone so I had to use a lua app and not ROBLOX)
function InverseChildren(Object) ChildTable = {} for Add = #Object, 1, -1 do table.insert(ChildTable, Object[Add]) end return ChildTable end
MyTab = {"one", "two", "three"} for Print = 1,#MyTab do print(MyTab[Print]) end
draw.sleep(1000)
for Print = 1,#InverseChildren(MyTab) do print(InverseChildren(MyTab)[Print]) end
Results
one two three three two one |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 21 Oct 2013 01:39 PM |
| it doesn't work with getchildren tho. |
|
|
| Report Abuse |
|
|