Instance:WaitForChildWhichIsA()

As a Roblox developer, it is currently too hard to combine :WaitForChild() & :FindFirstChildWhichIsA() in my code.

If Roblox is able to address this issue, it would improve my development experience because it would allow for me to have significantly cleaner player code (I use this behaviour a lot in my code).

Iirc a Roblox staff member at some point made a statement (please correct me if I’m wrong) suggesting that we use FindFirstChildWhichIsA("Humanoid") instead of FindFirstChild("Humanoid") since the Humanoid’s name can be anything. I would like to be able to use the equivalent in WaitForChild, as I would like my game to not rely on the Name property of players’ Humanoids being consistent.

On top of that, I think it makes sense that an equivalent exist anyway for the purpose of consistency. I think that adding WaitForChild for every :FindFirstX equivalent is a bit too much as afaik most of these functions are not very frequently used to be waiting for objects, but, I think that in the case of :FindFirstChildWhichIsA it makes sense to do this due to how frequently I find uses for it myself.

A few common use cases:
:WaitForChildWhichIsA("Configuration") - Wait for any Configuration but don’t require it to be named Configuration
:WaitForChildWhichIsA("Humanoid") - If you need to wait for the humanoid in an NPC or player character but you don’t want to name every humanoid Humanoid
script:WaitForChildWhichIsA("ModuleScript") - If you have a “starter” script that runs its child ModuleScripts this would be useful

54 Likes