Unless you’re tomarty and play god with the objects in your game, you chain WaitForChilds (or implement wrappers, as some did in that thread). I think I came up with an easy alternative that might be better?
local CollectionService = game:GetService("CollectionService")
local function CollectObject(tag)
local tagged = CollectionService:GetTagged(tag)
if tagged then
return tagged[1]
else
return CollectionService:GetInstanceAddedSignal(tag):Wait()
end
end
This uses CollectionService to get an object with a unique tag or wait until an object is given the tag. The key would be to also write a plugin that automatically parses your code for CollectObject
calls and tags the objects.
So is this stupid? As far as I know, there are no repercussions for having a zillion tags.
EDIT: Yeah this is dumb