of     1   

RevolutionGG
#35511427Saturday, October 16, 2010 10:23 AM GMT

It's a small funtion idea I came up of. Possible uses, may be useful. Name: ":getFamily(n)" Type: Function Description: This will return with a table with the family (Parent AND Children) of an object. The n represents how far it will return, so if I put 2, it will return with Parent's Parent, and Children's Children (also including the parent and the children). Example1 |Workspace |--Model |----Part |------Value |--------Script |------Script2 Inside Script2... family = script.Parent:getFamily(2) Returns with a table {Model, Workspace, Value, Script, Script2}. Example 2 |Players |--RevolutionGG |----Backpack |----StarterGear |----PlayerGui |------SceenGui |--------Frame |--------Script |----------TextButton Inside the script... t = script.Parent.Parent:getFamily(1) Returns with a table {StarterGear, Backpack, RevolutionGG, ScreenGui} Don't understand? Then ask me for further info...
RevolutionGG
#35511720Saturday, October 16, 2010 10:47 AM GMT

Bump.
Notunknown99
#35511780Saturday, October 16, 2010 10:51 AM GMT

So it returns the object the method was called on, and its children, and its childrens children? Why not GetDecendants() to return a table with the objects children, and there childrens children, and there childrens children, ect then insert the object into the table
Notunknown99
#35511804Saturday, October 16, 2010 10:52 AM GMT

Also, why bother with setting it to 1? Its the same as :children() and table.insert(tab,obj)
RevolutionGG
#35511825Saturday, October 16, 2010 10:54 AM GMT

It's also returning the relations within the Parent's object, so if you had torso and used :getFamily(1), you'd get Head, Legs, Arms, Scripts, Humanoid, Etc...
Notunknown99
#35511858Saturday, October 16, 2010 10:55 AM GMT

so +Model ++Torso:getFamily(1) ++Arms ++Legs ++Head ++Scripts Torso Arms Legs Head Scripts? Torso.Parent:children()
RevolutionGG
#35511888Saturday, October 16, 2010 10:57 AM GMT

Not only that, and also it return with their childrens, if they have one. |Workspace |--Model |----Brick |------Value |--------Script |----------StringValue If you use :getFamily(2) in the script, it will return with {Value, Brick, StringValue}.
Notunknown99
#35511915Saturday, October 16, 2010 10:59 AM GMT

So why not just make a GetDecendants() that returns a table with the instance's children, and there children, and there children. Like a not-so-laggy recusive script.
RevolutionGG
#35511936Saturday, October 16, 2010 11:00 AM GMT

Because it returns the Parent, too.
PiezRus
#35511945Saturday, October 16, 2010 11:01 AM GMT

great idea revolution, bump and support
RevolutionGG
#35512236Saturday, October 16, 2010 11:15 AM GMT

Bring up.
trappingnoobs
#35512324Saturday, October 16, 2010 11:18 AM GMT

Cant you use GetDescendants on it's parent? EG: function Lolcats(number) for i = 1, number do lolstring=lolstring..".Parent" end lolstring="script"..lolstring a=loadstring(lolstring)() return a:GetDescendants() end
RevolutionGG
#35512348Saturday, October 16, 2010 11:19 AM GMT

Workspace:getDescendant()? Then keep doing :IsA() over and over again?
trappingnoobs
#35512372Saturday, October 16, 2010 11:20 AM GMT

I'm not sure on loadstring but look what I posted.
RevolutionGG
#35512554Saturday, October 16, 2010 11:29 AM GMT

Possible.
Notunknown99
#35520211Saturday, October 16, 2010 2:57 PM GMT

'Because it returns the Parent, too.' modelnchildren = workspace.Model:decendants() --Contains the Children of Model, but not the Model table.insert(modelnchildren,workspace.Model) --Now contains the Children of Model, and Model
00Gravity00
#35520231Saturday, October 16, 2010 2:57 PM GMT

Sounds good supporg :D
numerlogi
#35520283Saturday, October 16, 2010 2:59 PM GMT

dude aready scriptable
Notunknown99
#35520550Saturday, October 16, 2010 3:04 PM GMT

@numer: Yes, but its laggy. a C(#/++) GetDecendants/Family (Decendants better) SHOULD lag less than Lua Get Family/Decendants
commander126
#35521739Saturday, October 16, 2010 3:24 PM GMT

[ Content Deleted ]
RevolutionGG
#35523346Saturday, October 16, 2010 3:52 PM GMT

Bump.
BeepBoopBop
#35523497Saturday, October 16, 2010 3:56 PM GMT

This is somewhat already scriptable.
RevolutionGG
#35523541Saturday, October 16, 2010 3:57 PM GMT

@BBB: True.

    of     1