function BufferCreator.CreateServerBuffer(a,G)local t=Instance.new("\070\111\108\100\101\114")t.Name=G t.Parent=Tool local d=CreateBuffer(t)local T function d.AddItem(a,G)G.Parent=t local d=G:IsA("\066\097\115\101\080\097\114\116")and G or G:FindFirstChildWhichIsA("\066\097\115\101\080\097\114\116",true)if d then local G=Vector3.new(math.random(-1000,1000),100000,math.random(-1000,1000))d.CFrame=CFrame.new(G)local a=Instance.new("\066\111\100\121\080\111\115\105\116\105\111\110")a.Position=G a.MaxForce=Vector3.new(math.huge,math.huge,math.huge)a.Name="\066\117\102\102\101\114\080\111\115\105\116\105\111\110\076\111\099\107"a.Parent=d if d:IsDescendantOf(game.Workspace)and(not d.Anchored and T)then d:SetNetworkOwner(T)end end end function d.SetCurrentPlayer(a,G)T=G for a,t in pairs(t:GetChildren())do local d=t:IsA("\066\097\115\101\080\097\114\116")and t or t:FindFirstChildWhichIsA("\066\097\115\101\080\097\114\116",true)if d and(d:IsDescendantOf(game.Workspace)and(not d.Anchored and T))then d:SetNetworkOwner(G)end end end return d end

function BufferCreator:CreateServerBuffer(BufferName)
	local BufferFolder = Instance.new("Folder")
	BufferFolder.Name = BufferName
	BufferFolder.Parent = Tool
	
	local Buffer = CreateBuffer(BufferFolder)
	local Player
	
	--Adds an item to the buffer.
	function Buffer:AddItem(NewItem)
		NewItem.Parent = BufferFolder
		
		local Part = (NewItem:IsA("BasePart") and NewItem) or NewItem:FindFirstChildWhichIsA("BasePart",true)
		if Part then
			--Add a position lock.
			local HoldPos = Vector3.new(math.random(-1000,1000),100000,math.random(-1000,1000))
			Part.CFrame = CFrame.new(HoldPos)
			local PositionLock = Instance.new("BodyPosition")
			PositionLock.Position = HoldPos
			PositionLock.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			PositionLock.Name = "BufferPositionLock"
			PositionLock.Parent = Part
			
			--Set the network ownership to the client so it can control physics.
			if Part:IsDescendantOf(game.Workspace) and not Part.Anchored and Player then
				Part:SetNetworkOwner(Player)
			end
		end
	end
	
	--Sets the network ownership of the buffer.
	function Buffer:SetCurrentPlayer(NewPlayer)
		Player = NewPlayer
		
		for _,Item in pairs(BufferFolder:GetChildren()) do
			local Part = (Item:IsA("BasePart") and Item) or Item:FindFirstChildWhichIsA("BasePart",true)
			
			if Part and Part:IsDescendantOf(game.Workspace) and not Part.Anchored and Player then
				Part:SetNetworkOwner(NewPlayer)
			end
		end
	end
	
	--Return the buffer class.
	return Buffer
end
