I’m have a folder of all my “gameobjects” in the workspace. When I make a new gameobject I have a script that figures out what type of gameobject it is by figuring out if it has a part named a certain name.
My issue is that when I use:
elseif newGameObject:FindFirstChild(".coreBuilding") then
it returns nil. But, when I use:
elseif newGameObject:WaitForChild(".coreBuilding") then
it returns the part named .coreBuilding
as it should. But I can’t use WaitForChild
because there is a chance that the new model won’t have the identifier .coreBuilding
! So there is a chance it could wait indefinitely.
What do I do?