function Step()for X=#garbage,1,-1 do local N=garbage[X]local K=N[1]local V=N[2]local f=N[3]local q=tick()-V if q>=f then if type(K)=="\116\097\098\108\101"then for X,N in ipairs(K)do N:Destroy()end else K:Destroy()end table.remove(garbage,X)end end end;(coroutine.wrap(function()while _L.Services.RunService.Heartbeat:Wait()do Step()end end))()return function(X,N)if not N then N=10 end table.insert(garbage,{X;tick();N})end
--[[
	
	Alternative to game.Debris:AddItem() which runs on heartbeat (and runs better, for that matter)
	
	60hz accurate
	
	also supports array of objects in 1st arg
		
--]]

function Step()
	--- scan garbage for items that are expired and clean them up
	for i = #garbage, 1, -1 do
		local v = garbage[i]
		local obj = v[1]
		local t = v[2]
		local removetime = v[3]
		local tp = (tick() - t)
		if tp >= removetime then
			if type(obj) == "table" then
				for _, objchild in ipairs(obj) do
					objchild:Destroy()
				end
			else
				obj:Destroy()
			end
			table.remove(garbage, i)
		end
	end
end

coroutine.wrap(function() --- main loop
	while _L.Services.RunService.Heartbeat:Wait() do
		Step()
	end
end)()

return function(obj, t)
	if not t then
		t = 10
	end
	--- add to garbage
	table.insert(garbage, { obj, tick(), t })
end
