|
| 05 Oct 2016 09:44 PM |
Basically, check if something have children and check the children of their children and so on...
~Wiggles |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Oct 2016 09:55 PM |
check = function(name,location) local objects = {} for i,v in next, location:GetChildren() do if v.Name == name then objects[v] = true end check(name,v) end end
local objects = check('Part',workspace)
for part,val in next, objects do print(part.Name) end
|
|
|
| Report Abuse |
|
|
|
| 05 Oct 2016 10:08 PM |
:findfirstchild(';p;',true)
im a mlg |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2016 10:09 PM |
@Weird trying to get a class, not the name of an object
~Wiggles |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Oct 2016 11:25 PM |
then is :IsA()
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 05:33 AM |
use*
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Oct 2016 08:20 AM |
@OP
check = function(Class,location) local objects = {} for i,v in next, location:GetChildren() do if v:IsA(Class) then objects[v] = true end check(name,v) end end
local objects = check('BasePart',workspace)
for part in next, objects do print(part.Name) end
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Oct 2016 08:21 AM |
change the 'check(name,v)' to check(Class,v) *
Yes all i did was literally change 1 thing to make it check for a specific class. Not that hard.
|
|
|
| Report Abuse |
|
|