drtbik12
|
  |
| Joined: 22 Jun 2011 |
| Total Posts: 85 |
|
| |
|
| |
|
drtbik12
|
  |
| Joined: 22 Jun 2011 |
| Total Posts: 85 |
|
|
| 07 Sep 2013 09:58 PM |
| Like model:WaitForChild("Part"), but for multiple parts. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 09:59 PM |
object:WaitForChild("SomeObjectName") player.Character:WaitForChild("Torso")
Something like that? |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 09:59 PM |
| Multiple parts of the same name? If that's so, you might need to know the number of parts you are expecting. |
|
|
| Report Abuse |
|
|
drtbik12
|
  |
| Joined: 22 Jun 2011 |
| Total Posts: 85 |
|
|
| 07 Sep 2013 10:02 PM |
| In the same line, I think it's something like this: model:WaitForChild("Part1","Part2") :D |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 10:02 PM |
Just make a custom function :0.
function waitFor(Parent,...) local Args = {...} wait() local Okay = true for _,n in ipairs(Args) do if not Parent:FindFirstChild(n) then Okay = false end end if Okay then return end waitFor(Parent,Args) end
waitFor(Workspace,"Hi","Bob") |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 07 Sep 2013 10:04 PM |
script.Parent:WaitForChild("Part", "Part1") Im not sure if this will work, i dont use WaitForChild alot. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 10:05 PM |
It would be nice if it still returned the list of objects you were waiting for though:
function WaitForChildren(parent, ...) local children = {} for _,n in pairs{...} do table.insert(children, parent:WaitForChild(n)) end return unpack(children) end
local obj1, obj2, obj3 = WaitForChildren(game.Workspace, "BasePlate", "Camera", "Terrain") |
|
|
| Report Abuse |
|
|
drtbik12
|
  |
| Joined: 22 Jun 2011 |
| Total Posts: 85 |
|
| |
|