Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiler will be improved soon!
- -- Decompiled with Konstant V2.1, a fast Luau decompiler made in Luau by plusgiant5 (https://discord.gg/wyButjTMhM)
- -- Decompiled on 2024-12-09 07:19:48
- -- Luau version 6, Types version 3
- -- Time taken: 0.004543 seconds
- local module_upvr = require(script:WaitForChild("Table"))
- local module_upvr_2 = {}
- module_upvr_2.__index = module_upvr_2
- module_upvr_2.__type = "PartCache"
- local cframe_upvr = CFrame.new(0, 1000000000, 0)
- local function _(arg1, arg2) -- Line 60, Named "assertwarn"
- if arg1 == false then
- warn(arg2)
- end
- end
- local function _(arg1, arg2) -- Line 67, Named "MakeFromTemplate"
- --[[ Upvalues[1]:
- [1]: cframe_upvr (readonly)
- ]]
- local clone = arg1:Clone()
- clone.CFrame = cframe_upvr
- clone.Anchored = true
- clone.Parent = arg2
- return clone
- end
- function module_upvr_2.new(arg1, arg2, arg3) -- Line 77
- --[[ Upvalues[3]:
- [1]: module_upvr_2 (readonly)
- [2]: module_upvr (readonly)
- [3]: cframe_upvr (readonly)
- ]]
- -- KONSTANTWARNING: Variable analysis failed. Output will have some incorrect variable assignments
- local var9
- if not arg3 then
- end
- if 0 >= arg2 then
- var9 = false
- else
- var9 = true
- end
- assert(var9, "PrecreatedParts can not be negative!")
- if arg2 == 0 then
- else
- end
- if true == false then
- var9 = warn
- var9("PrecreatedParts is 0! This may have adverse effects when initially using the cache.")
- end
- if arg1.Archivable == false then
- var9 = warn
- var9("The template's Archivable property has been set to false, which prevents it from being cloned. It will temporarily be set to true.")
- end
- var9 = true
- arg1.Archivable = var9
- var9 = arg1:Clone()
- arg1.Archivable = arg1.Archivable
- local var10 = var9
- local tbl = {
- Open = {};
- InUse = {};
- CurrentCacheParent = workspace;
- Template = var10;
- ExpansionSize = 10;
- }
- setmetatable(tbl, module_upvr_2)
- for _ = 1, arg2 or 5 do
- local clone_3 = var10:Clone()
- clone_3.CFrame = cframe_upvr
- clone_3.Anchored = true
- clone_3.Parent = tbl.CurrentCacheParent
- module_upvr.insert(tbl.Open, clone_3)
- local var13
- end
- var13.Template.Parent = nil
- return var13
- end
- function module_upvr_2.GetPart(arg1) -- Line 115
- --[[ Upvalues[3]:
- [1]: module_upvr_2 (readonly)
- [2]: module_upvr (readonly)
- [3]: cframe_upvr (readonly)
- ]]
- local var16
- if getmetatable(arg1) ~= module_upvr_2 then
- var16 = false
- else
- var16 = true
- end
- assert(var16, "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"))
- var16 = arg1.Open
- if #var16 == 0 then
- var16 = 1
- for _ = 1, arg1.ExpansionSize, var16 do
- local clone_2 = arg1.Template:Clone()
- clone_2.CFrame = cframe_upvr
- clone_2.Anchored = true
- clone_2.Parent = arg1.CurrentCacheParent
- module_upvr.insert(arg1.Open, clone_2)
- end
- end
- var16 = arg1.Open
- local var18 = var16[#arg1.Open]
- var16 = arg1.Open
- var16[#arg1.Open] = nil
- var16 = module_upvr.insert
- var16(arg1.InUse, var18)
- return var18
- end
- function module_upvr_2.ReturnPart(arg1, arg2) -- Line 131
- --[[ Upvalues[3]:
- [1]: module_upvr_2 (readonly)
- [2]: module_upvr (readonly)
- [3]: cframe_upvr (readonly)
- ]]
- local var19
- if getmetatable(arg1) ~= module_upvr_2 then
- var19 = false
- else
- var19 = true
- end
- assert(var19, "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"))
- var19 = module_upvr
- var19 = arg1.InUse
- local any_indexOf_result1 = var19.indexOf(var19, arg2)
- if any_indexOf_result1 ~= nil then
- var19 = module_upvr.remove
- var19(arg1.InUse, any_indexOf_result1)
- var19 = module_upvr.insert
- var19(arg1.Open, arg2)
- var19 = cframe_upvr
- arg2.CFrame = var19
- var19 = true
- arg2.Anchored = var19
- else
- var19 = error
- var19("Attempted to return part \""..arg2.Name.."\" ("..arg2:GetFullName()..") to the cache, but it's not in-use! Did you call this on the wrong part?")
- end
- end
- function module_upvr_2.SetCacheParent(arg1, arg2) -- Line 146
- --[[ Upvalues[1]:
- [1]: module_upvr_2 (readonly)
- ]]
- local var25
- if getmetatable(arg1) ~= module_upvr_2 then
- var25 = false
- else
- var25 = true
- end
- assert(var25, "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"))
- var25 = arg2:IsDescendantOf(workspace)
- if not var25 then
- if arg2 ~= workspace then
- var25 = false
- else
- var25 = true
- end
- end
- assert(var25, "Cache parent is not a descendant of Workspace! Parts should be kept where they will remain in the visible world.")
- arg1.CurrentCacheParent = arg2
- var25 = 1
- for i_3 = 1, #arg1.Open, var25 do
- arg1.Open[i_3].Parent = arg2
- end
- var25 = 1
- for i_4 = 1, #arg1.InUse, var25 do
- arg1.InUse[i_4].Parent = arg2
- end
- end
- function module_upvr_2.Expand(arg1, arg2) -- Line 160
- --[[ Upvalues[3]:
- [1]: module_upvr_2 (readonly)
- [2]: module_upvr (readonly)
- [3]: cframe_upvr (readonly)
- ]]
- -- KONSTANTWARNING: Variable analysis failed. Output will have some incorrect variable assignments
- local var30
- if getmetatable(arg1) ~= module_upvr_2 then
- var30 = false
- else
- var30 = true
- end
- assert(var30, "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 arg2 == nil then
- end
- var30 = 1
- for _ = 1, arg1.ExpansionSize, var30 do
- local clone_4 = arg1.Template:Clone()
- clone_4.CFrame = cframe_upvr
- clone_4.Anchored = true
- clone_4.Parent = arg1.CurrentCacheParent
- module_upvr.insert(arg1.Open, clone_4)
- end
- end
- function module_upvr_2.Dispose(arg1) -- Line 172
- --[[ Upvalues[1]:
- [1]: module_upvr_2 (readonly)
- ]]
- local var36
- if getmetatable(arg1) ~= module_upvr_2 then
- var36 = false
- else
- var36 = true
- end
- assert(var36, "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"))
- var36 = 1
- for i_6 = 1, #arg1.Open, var36 do
- arg1.Open[i_6]:Destroy()
- end
- var36 = 1
- for i_7 = 1, #arg1.InUse, var36 do
- arg1.InUse[i_7]:Destroy()
- end
- arg1.Template:Destroy()
- arg1.Open = {}
- arg1.InUse = {}
- arg1.CurrentCacheParent = nil
- arg1.GetPart = nil
- arg1.ReturnPart = nil
- arg1.SetCacheParent = nil
- arg1.Expand = nil
- arg1.Dispose = nil
- end
- return module_upvr_2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement