--Creates a buffer class.

local function CreateBuffer(Folder)
	local Buffer = {}
	
	--Removes an item from the buffer.
	function Buffer:PopItem()
		local NextItem = Folder:GetChildren()[1]
		
		if NextItem then
			--Remove the position lock.
			local BufferPositionLock = NextItem:FindFirstChild("BufferPositionLock",true)
			if BufferPositionLock then
				BufferPositionLock:Destroy()
			end
			
			--Reparent it to Workspace.
			NextItem.Parent = game.Workspace
			
			--Return the item.
			return NextItem
		end
	end
	
	--Return the buffer class.
	return Buffer
end


