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: Is there a way to GetChildren Backwards?

Previous Thread :: Next Thread 
enyahs7 is not online. 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 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 10:19 AM
We just switch it around right?
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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 is not online. 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
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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 is not online. 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
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
21 Oct 2013 10:46 AM
Thats what I gave you.

for a = 1,#InverseChildren(Workspace) do
print(InverseChildren(Workspace)[a])
end
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
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 is not online. 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 is not online. 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 is not online. 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 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 10:59 AM
its still printing the 3,4,1,2.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
21 Oct 2013 11:03 AM
Whats wrong with what I said? Its exactly what you asked for -.-
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 11:07 AM
It does not work.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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 is not online. 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
Picosecond is not online. Picosecond
Joined: 08 Dec 2012
Total Posts: 2984
21 Oct 2013 11:37 AM
do u even list?
Report Abuse
enyahs7 is not online. 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
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
21 Oct 2013 12:17 PM
Are you trying to get values out of a table?
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 12:18 PM
Get the Values in the correct order.
Report Abuse
IcyFlammable is not online. IcyFlammable
Joined: 20 Aug 2013
Total Posts: 4323
21 Oct 2013 12:22 PM
Lmfao "GetChildren Backwards"
xd
sounds wrong
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 12:23 PM
...
Report Abuse
IcyFlammable is not online. IcyFlammable
Joined: 20 Aug 2013
Total Posts: 4323
21 Oct 2013 12:24 PM
xdd
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
21 Oct 2013 01:39 PM
it doesn't work with getchildren tho.
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