function module.WaitForDescendant(Parent: Instance, Name: string)
repeat task.wait() until module.FindFirstDescendant(Parent,Name)
return module.FindFirstDescendant(Parent,Name)
end
function module.WaitForChildWhichIsA(Parent: Instance, ClassName: string)
repeat task.wait() until Parent:FindFirstChildWhichIsA(ClassName)
return Parent:FindFirstChildWhichIsA(ClassName)
end
The implementation of the WaitFor function makes use of polling which is kinda not good and resource intensive.
Thanks for the feedback, but this isn’t really a serious project so I made it in about 15 minutes, I can update it if the performance hit is really bad.