local i={}i.__index=i i.__type="\080\097\114\116\067\097\099\104\101"local M=CFrame.new(0,1000000000,0)local Y=require(script:WaitForChild("\084\097\098\108\101"))function i.new(U,X,C)assert(X>0,"\080\114\101\099\114\101\097\116\101\100\080\097\114\116\115 \099\097\110 \110\111\116 \098\101 \110\101\103\097\116\105\118\101\033")if(X~=0)==false then warn("\080\114\101\099\114\101\097\116\101\100\080\097\114\116\115 \105\115 \048\033 \084\104\105\115 \109\097\121 \104\097\118\101 \097\100\118\101\114\115\101 \101\102\102\101\099\116\115 \119\104\101\110 \105\110\105\116\105\097\108\108\121 \117\115\105\110\103 \116\104\101 \099\097\099\104\101\046")end if U.Archivable==false then warn("\084\104\101 \116\101\109\112\108\097\116\101\'\115 \065\114\099\104\105\118\097\098\108\101 \112\114\111\112\101\114\116\121 \104\097\115 \098\101\101\110 \115\101\116 \116\111 \102\097\108\115\101\044 \119\104\105\099\104 \112\114\101\118\101\110\116\115 \105\116 \102\114\111\109 \098\101\105\110\103 \099\108\111\110\101\100\046 \073\116 \119\105\108\108 \116\101\109\112\111\114\097\114\105\108\121 \098\101 \115\101\116 \116\111 \116\114\117\101\046")end U.Archivable=true U.Archivable=U.Archivable U=U:Clone()local I={Open={};InUse={},CurrentCacheParent=C or workspace,Template=U;ExpansionSize=10}setmetatable(I,i)for i=1,X and 5,1 do local X=U:Clone()X.CFrame=M X.Anchored=true X.Parent=I.CurrentCacheParent Y.insert(I.Open,X)end I.Template.Parent=nil return I end function i.GetPart(U)assert(getmetatable(U)==i,("\067\097\110\110\111\116 \115\116\097\116\105\099\097\108\108\121 \105\110\118\111\107\101 \109\101\116\104\111\100 \'\037\115\' - \073\116 \105\115 \097\110 \105\110\115\116\097\110\099\101 \109\101\116\104\111\100\046 \067\097\108\108 \105\116 \111\110 \097\110 \105\110\115\116\097\110\099\101 \111\102 \116\104\105\115 \099\108\097\115\115 \099\114\101\097\116\101\100 \118\105\097 \037\115"):format("\071\101\116\080\097\114\116","\080\097\114\116\067\097\099\104\101\046\110\101\119"))if#U.Open==0 then for i=1,U.ExpansionSize,1 do local X=U.Template:Clone()X.CFrame=M X.Anchored=true X.Parent=U.CurrentCacheParent Y.insert(U.Open,X)end end local X=U.Open[#U.Open]U.Open[#U.Open]=nil Y.insert(U.InUse,X)return X end function i.ReturnPart(U,X)assert(getmetatable(U)==i,("\067\097\110\110\111\116 \115\116\097\116\105\099\097\108\108\121 \105\110\118\111\107\101 \109\101\116\104\111\100 \'\037\115\' - \073\116 \105\115 \097\110 \105\110\115\116\097\110\099\101 \109\101\116\104\111\100\046 \067\097\108\108 \105\116 \111\110 \097\110 \105\110\115\116\097\110\099\101 \111\102 \116\104\105\115 \099\108\097\115\115 \099\114\101\097\116\101\100 \118\105\097 \037\115"):format("\082\101\116\117\114\110\080\097\114\116","\080\097\114\116\067\097\099\104\101\046\110\101\119"))local C=Y.indexOf(U.InUse,X)if C==nil then return end Y.remove(U.InUse,C)Y.insert(U.Open,X)X.CFrame=M X.Anchored=true end function i.SetCacheParent(M,Y)assert(getmetatable(M)==i,("\067\097\110\110\111\116 \115\116\097\116\105\099\097\108\108\121 \105\110\118\111\107\101 \109\101\116\104\111\100 \'\037\115\' - \073\116 \105\115 \097\110 \105\110\115\116\097\110\099\101 \109\101\116\104\111\100\046 \067\097\108\108 \105\116 \111\110 \097\110 \105\110\115\116\097\110\099\101 \111\102 \116\104\105\115 \099\108\097\115\115 \099\114\101\097\116\101\100 \118\105\097 \037\115"):format("\083\101\116\067\097\099\104\101\080\097\114\101\110\116","\080\097\114\116\067\097\099\104\101\046\110\101\119"))assert(Y:IsDescendantOf(workspace)or Y==workspace,"\067\097\099\104\101 \112\097\114\101\110\116 \105\115 \110\111\116 \097 \100\101\115\099\101\110\100\097\110\116 \111\102 \087\111\114\107\115\112\097\099\101\033 \080\097\114\116\115 \115\104\111\117\108\100 \098\101 \107\101\112\116 \119\104\101\114\101 \116\104\101\121 \119\105\108\108 \114\101\109\097\105\110 \105\110 \116\104\101 \118\105\115\105\098\108\101 \119\111\114\108\100\046")M.CurrentCacheParent=Y for i=1,#M.Open,1 do M.Open[i].Parent=Y end for i=1,#M.InUse,1 do M.InUse[i].Parent=Y end end function i.Expand(U,X)assert(getmetatable(U)==i,("\067\097\110\110\111\116 \115\116\097\116\105\099\097\108\108\121 \105\110\118\111\107\101 \109\101\116\104\111\100 \'\037\115\' - \073\116 \105\115 \097\110 \105\110\115\116\097\110\099\101 \109\101\116\104\111\100\046 \067\097\108\108 \105\116 \111\110 \097\110 \105\110\115\116\097\110\099\101 \111\102 \116\104\105\115 \099\108\097\115\115 \099\114\101\097\116\101\100 \118\105\097 \037\115"):format("\069\120\112\097\110\100","\080\097\114\116\067\097\099\104\101\046\110\101\119"))if X==nil then X=U.ExpansionSize end for i=1,X,1 do local X=U.Template:Clone()X.CFrame=M X.Anchored=true X.Parent=U.CurrentCacheParent Y.insert(U.Open,X)end end function i.Dispose(M)assert(getmetatable(M)==i,("\067\097\110\110\111\116 \115\116\097\116\105\099\097\108\108\121 \105\110\118\111\107\101 \109\101\116\104\111\100 \'\037\115\' - \073\116 \105\115 \097\110 \105\110\115\116\097\110\099\101 \109\101\116\104\111\100\046 \067\097\108\108 \105\116 \111\110 \097\110 \105\110\115\116\097\110\099\101 \111\102 \116\104\105\115 \099\108\097\115\115 \099\114\101\097\116\101\100 \118\105\097 \037\115"):format("\068\105\115\112\111\115\101","\080\097\114\116\067\097\099\104\101\046\110\101\119"))for i=1,#M.Open,1 do M.Open[i]:Destroy()end for i=1,#M.InUse,1 do M.InUse[i]:Destroy()end M.Template:Destroy()M.Open={}M.InUse={}M.CurrentCacheParent=nil M.GetPart=nil M.ReturnPart=nil M.SetCacheParent=nil M.Expand=nil M.Dispose=nil end return i
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {}
v1.__index = v1
v1.__type = "PartCache"
local u1 = CFrame.new(0, 1000000000, 0)
local u2 = require(script:WaitForChild("Table"))
function v1.new(p1, p2, p3)
	assert(p2 > 0, "PrecreatedParts can not be negative!")
	if p2 ~= 0 == false then
		warn("PrecreatedParts is 0! This may have adverse effects when initially using the cache.")
	end
	if p1.Archivable == false then
		warn(
			"The template's Archivable property has been set to false, which prevents it from being cloned. It will temporarily be set to true."
		)
	end
	p1.Archivable = true
	p1.Archivable = p1.Archivable
	p1 = p1:Clone()
	local v2 = {
		Open = {},
		InUse = {},
		CurrentCacheParent = p3 or workspace,
		Template = p1,
		ExpansionSize = 10,
	}
	setmetatable(v2, v1)
	for v3 = 1, p2 and 5 do
		local v4 = p1:Clone()
		v4.CFrame = u1
		v4.Anchored = true
		v4.Parent = v2.CurrentCacheParent
		u2.insert(v2.Open, v4)
	end
	v2.Template.Parent = nil
	return v2
end
function v1.GetPart(p4)
	assert(
		getmetatable(p4) == v1,
		("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format(
			"GetPart",
			"PartCache.new"
		)
	)
	if #p4.Open == 0 then
		for v5 = 1, p4.ExpansionSize do
			local v6 = p4.Template:Clone()
			v6.CFrame = u1
			v6.Anchored = true
			v6.Parent = p4.CurrentCacheParent
			u2.insert(p4.Open, v6)
		end
	end
	local v7 = p4.Open[#p4.Open]
	p4.Open[#p4.Open] = nil
	u2.insert(p4.InUse, v7)
	return v7
end
function v1.ReturnPart(p5, p6)
	assert(
		getmetatable(p5) == v1,
		("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format(
			"ReturnPart",
			"PartCache.new"
		)
	)
	local v8 = u2.indexOf(p5.InUse, p6)
	if v8 == nil then
		return
	end
	u2.remove(p5.InUse, v8)
	u2.insert(p5.Open, p6)
	p6.CFrame = u1
	p6.Anchored = true
end
function v1.SetCacheParent(p7, p8)
	assert(
		getmetatable(p7) == v1,
		("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format(
			"SetCacheParent",
			"PartCache.new"
		)
	)
	assert(
		p8:IsDescendantOf(workspace) or p8 == workspace,
		"Cache parent is not a descendant of Workspace! Parts should be kept where they will remain in the visible world."
	)
	p7.CurrentCacheParent = p8
	for v9 = 1, #p7.Open do
		p7.Open[v9].Parent = p8
	end
	for v10 = 1, #p7.InUse do
		p7.InUse[v10].Parent = p8
	end
end
function v1.Expand(p9, p10)
	assert(
		getmetatable(p9) == v1,
		("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format(
			"Expand",
			"PartCache.new"
		)
	)
	if p10 == nil then
		p10 = p9.ExpansionSize
	end
	for v11 = 1, p10 do
		local v12 = p9.Template:Clone()
		v12.CFrame = u1
		v12.Anchored = true
		v12.Parent = p9.CurrentCacheParent
		u2.insert(p9.Open, v12)
	end
end
function v1.Dispose(p11)
	assert(
		getmetatable(p11) == v1,
		("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format(
			"Dispose",
			"PartCache.new"
		)
	)
	for v13 = 1, #p11.Open do
		p11.Open[v13]:Destroy()
	end
	for v14 = 1, #p11.InUse do
		p11.InUse[v14]:Destroy()
	end
	p11.Template:Destroy()
	p11.Open = {}
	p11.InUse = {}
	p11.CurrentCacheParent = nil
	p11.GetPart = nil
	p11.ReturnPart = nil
	p11.SetCacheParent = nil
	p11.Expand = nil
	p11.Dispose = nil
end
return v1
