function recyclingBin.Allocate(F,S,G,E)local o={}local d=0 for E,e in pairs(E:GetChildren())do if e:IsA(S)then d=d+1 if d>G then F:Recycle(e)else o[d]=e end end end while d<G do d=d+1 o[d]=F:Pull(S,E)end return o end return recyclingBin


function recyclingBin:Allocate(objectType,needed,bin)
	local allocation = {}
	local allocated = 0
	for _,v in pairs(bin:GetChildren()) do
		if v:IsA(objectType) then
			allocated = allocated + 1
			if allocated > needed then
				self:Recycle(v)
			else
				allocation[allocated] = v
			end
		end
	end
	while allocated < needed do
		allocated = allocated + 1
		allocation[allocated] = self:Pull(objectType,bin)
	end
	return allocation
end

return recyclingBin
