function Maid.GiveTask(U,a)local q=#U._tasks+1 U._tasks[q]=a return function()U._tasks[q]=nil end end function Maid.GiveTasks(a,...)for U,q in next,{...}do a:GiveTask(q)end end function Maid.DoCleaning(a)for U,q in next,a._tasks do a._tasks[U]=nil local y=type(q)if y=="\116\097\098\108\101"then q:Destroy()elseif y=="\102\117\110\099\116\105\111\110"then q()else q:Disconnect()end end end Maid.Destroy=Maid.DoCleaning



function Maid:GiveTask(task)
	local index = #self._tasks + 1
	self._tasks[index] = task

	return function()
		self._tasks[index] = nil
	end
end


function Maid:GiveTasks(...)
	for _, task in next, {...} do
		self:GiveTask(task)
	end
end


function Maid:DoCleaning()
	for index, task in next, self._tasks do
		self._tasks[index] = nil

		local T = type(task)
		if T == 'table' then
			task:Destroy()
		elseif T == 'function' then
			task()
		else -- RbxScriptConnection
			task:Disconnect()
		end
	end
end


Maid.Destroy = Maid.DoCleaning

