function BrioUtils.first(a,...)for a,I in pairs(a)do if Brio.isBrio(I)then if I:IsDead()then return Brio.DEAD end end end local I=Maid.new()local X=Brio.new(...)for a,u in pairs(a)do if Brio.isBrio(u)then I:GiveTask((u:GetDiedSignal()):Connect(function()X:Kill()end))end end I:GiveTask((X:GetDiedSignal()):Connect(function()I:DoCleaning()end))return X end
--[=[
	Returns a brio that dies whenever the first Brio in the list
	dies. The value of the Brio is the `...` value.

	@param brios {Brio<T>}
	@param ... U
	@return Brio<U>
]=]
function BrioUtils.first(brios, ...)
	for _, brio in pairs(brios) do
		if Brio.isBrio(brio) then
			if brio:IsDead() then
				return Brio.DEAD
			end
		end
	end

	local maid = Maid.new()
	local topBrio = Brio.new(...)

	for _, brio in pairs(brios) do
		if Brio.isBrio(brio) then
			maid:GiveTask(brio:GetDiedSignal():Connect(function()
				topBrio:Kill()
			end))
		end
	end

	maid:GiveTask(topBrio:GetDiedSignal():Connect(function()
		maid:DoCleaning()
	end))

	return topBrio
end
