local K=5 local i=Vector3.new(0,0,0)local function d(K)local d=Instance.new("\077\111\100\101\108")d.Parent=K.Parent local L=Instance.new("\080\097\114\116")L.Anchored=true L.CanCollide=false L.Transparency=1 L.Parent=d d.PrimaryPart=L if K:IsA("\077\111\100\101\108")and K.PrimaryPart then L.Position=K.PrimaryPart.Position else L.Position=i end K.Parent=d return d end local function L(K,i)local d=0 for L=#K,1,-1 do local Q=K[L]if Q and Q.Parent then Q:Destroy()end table.remove(K,L)d+=1 if#K<=0 then return true elseif d>=i then return false end end end
-- Variables
local DefaultTime = 5 -- Default is to delete over 5 seconds
local DefaultScenePosition = Vector3.new(0, 0, 0)

local function GiveObjectPrimaryPart(Obj)
	-- Setup the object inside a model, provide a PrimaryPart
	local Model = Instance.new("Model")
	Model.Parent = Obj.Parent
	local Part = Instance.new("Part")
	Part.Anchored = true
	Part.CanCollide = false
	Part.Transparency = 1
	Part.Parent = Model
	Model.PrimaryPart = Part
	if Obj:IsA("Model") and Obj.PrimaryPart then
		Part.Position = Obj.PrimaryPart.Position
	else
		Part.Position = DefaultScenePosition
	end
	Obj.Parent = Model
	return Model
end

local function DeleteAmountOfObjectsInTable(Table, DeleteGoal)
	local JustDestroyed = 0
	for i = #Table, 1, -1 do
		local Object = Table[i]
		if Object and Object.Parent then
			Object:Destroy()
		end
		table.remove(Table, i)
		JustDestroyed += 1
		if #Table <= 0 then
			return true
		elseif JustDestroyed >= DeleteGoal then
			return false
		end
	end
end
