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


