local s=game:GetService("\080\108\097\121\101\114\115")local u=require(script.Parent.Promise)local function c(c)return u.Defer(function(u)local E=Instance.new("\077\111\100\101\108")for u,c in ipairs(c:GetDescendants())do if c:IsA("\066\097\115\101\080\097\114\116")and(not c:IsA("\084\101\114\114\097\105\110")and c.Archivable)then local u=c:FindFirstAncestorOfClass("\077\111\100\101\108")if u then if s:GetPlayerFromCharacter(u)then continue end end local k=c:Clone()k.Anchored=true k.Parent=E end end u(E)end)end return c
local Players = game:GetService("Players")
local Promise = require(script.Parent.Promise)

local function PromiseClone(Parent)
	return Promise.Defer(function(Resolve)
		local NewModel = Instance.new("Model")
		for _, Descendant in ipairs(Parent:GetDescendants()) do
			if Descendant:IsA("BasePart") and not Descendant:IsA("Terrain") and Descendant.Archivable then
				local Model = Descendant:FindFirstAncestorOfClass("Model")
				if Model then
					if Players:GetPlayerFromCharacter(Model) then
						continue
					end
				end

				local Clone = Descendant:Clone()
				Clone.Anchored = true
				Clone.Parent = NewModel
			end
		end

		Resolve(NewModel)
	end)
end

return PromiseClone