local N={}local y=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")function TryRemoveChildWithVerifyingIsCorrectType(y)if waitChildren[y.Name]and y:IsA(waitChildren[y.Name])then waitChildren[y.Name]=nil N[y.Name]=y numChildrenRemaining=numChildrenRemaining-1 end end for N,y in pairs(EventFolder:GetChildren())do TryRemoveChildWithVerifyingIsCorrectType(y)end if numChildrenRemaining>0 then local N=EventFolder.ChildAdded:connect(function(N)TryRemoveChildWithVerifyingIsCorrectType(N)if numChildrenRemaining<1 then y:Fire()end end)y.Event:wait()N:disconnect()y:Destroy()end EventFolder=N


local useEvents = {}

local FoundAllEventsEvent = Instance.new("BindableEvent")

function TryRemoveChildWithVerifyingIsCorrectType(child)
	if (waitChildren[child.Name] and child:IsA(waitChildren[child.Name])) then
		waitChildren[child.Name] = nil
		useEvents[child.Name] = child
		numChildrenRemaining = numChildrenRemaining - 1
	end
end

for i, child in pairs(EventFolder:GetChildren()) do
	TryRemoveChildWithVerifyingIsCorrectType(child)
end

if (numChildrenRemaining > 0) then
	local con = EventFolder.ChildAdded:connect(function(child)
		TryRemoveChildWithVerifyingIsCorrectType(child)
		if (numChildrenRemaining < 1) then
			FoundAllEventsEvent:Fire()
		end
	end)

	FoundAllEventsEvent.Event:wait()
	con:disconnect()

	FoundAllEventsEvent:Destroy()
end

EventFolder = useEvents


