Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 24 Apr 2012 04:01 PM |
| My friend told me that I would be sucessful in ROBLOX , if I leanred how to script , so my question is , what is GetChildren? |
|
|
| Report Abuse |
|
|
Grannel
|
  |
| Joined: 07 Nov 2010 |
| Total Posts: 565 |
|
|
| 24 Apr 2012 04:02 PM |
| Hi! Welcome to ROBLOX. Please, if you have any questions, you can ask them on "Scripting Helpers". This is for advanced discussions. Thanks and good luck! |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 24 Apr 2012 04:03 PM |
It's here anyways.
*Ahem (clears troath)*.
GetChildren() returns a table containing all the objects within the object where the method was called on. |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2012 04:04 PM |
It's in all BaseParts (BasePart::GetChildren()) and returns all objects who have their 'Parent' property set to the model.
Since everything in roblox is absolutely positioned, other than GUIs, in the 3D space parenting has no real effect from what I can think of, so it's mainly used to organise things to make you scan less data.
Ie
Workspace.Nodes:GetChildren()
And looping the result
Is more efficient than putting the nodes in workspace and doing Workspace:GetChildren() then checking if it's a node then doing whatever to it. |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 24 Apr 2012 04:06 PM |
Guys,Trapping is proubaly a better scripter than all of you.
And (Forgot name) scripting helpers is dumb. All of them tell me 'Free Models'. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 24 Apr 2012 04:07 PM |
LOL, trying to help and rapidly gets insulted.
G'day... |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2012 04:07 PM |
I'm not a better scripter than everyone :l
Where'd you get that logic from? O.o |
|
|
| Report Abuse |
|
|
Grannel
|
  |
| Joined: 07 Nov 2010 |
| Total Posts: 565 |
|
|
| 24 Apr 2012 04:07 PM |
| If you're really new, you have no possible way of telling if Trapping is better than us. Scripters forum is made for advanced Lua discussions, not to teach new players basic things like GetChildren. |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2012 04:08 PM |
grannel y u no fix your other post past the filter so that you posted and my prediction came true?
now I look like a fail at prediction magic ;'( |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Grannel
|
  |
| Joined: 07 Nov 2010 |
| Total Posts: 565 |
|
|
| 24 Apr 2012 04:16 PM |
Recursive functions ftw!
function get(x) t={} for i,v in x:GetChildren(), next do table.insert(t,v) get(v) end return t; end
|
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 24 Apr 2012 04:20 PM |
Yeah oysi's right
I honestly cannot beleive I wrote that
not sure if momentary lapse of stupidity, information overload from chemistry revision, tiredness, or too much dr pepper, or all of the above (6 cans in the last 3 hours lol) |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 24 Apr 2012 04:32 PM |
| This is a funny joke, Garnished. |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 24 Apr 2012 09:30 PM |
| Wow , really saw lots of people post 'hahahaha'. |
|
|
| Report Abuse |
|
|