parts_table=script.Parent:GetChildren()round=function(p)local E,u=math.modf(p)if p%1~=0 then return math.floor(p)+math.floor(u*10)/10 else return math.floor(p)end end function convertSizeToScale(p)for p,E in pairs(p)do if E:IsA("\066\097\115\101\080\097\114\116")then if E:findFirstChild("\077\101\115\104")then if not E.Size==Vector3.new(.2,.2,.2)then local p=E.Mesh local u=E.Size local z=p.Scale local a=u.X/z.X local X=u.Y/z.Y local F=u.Z/z.Z local Q=Vector3.new(0,0,0)if round(E.Size.X*10)/10~=.2 then print(E.Name,E.Size.X)Q=Q+Vector3.new(a*5,0,0)else Q=Q+Vector3.new(p.Scale.X,0,0)end if round(E.Size.Y*10)/10~=.2 then Q=Q+Vector3.new(0,X*5,0)else Q=Q+Vector3.new(0,p.Scale.Y,0)end if round(E.Size.Z*10)/10~=.2 then Q=Q+Vector3.new(0,0,F*5)else Q=Q+Vector3.new(0,0,p.Scale.Z)end local k=E.CFrame E.Size=Vector3.new(.2,.2,.2)E.CFrame=k p.Scale=Q end end end end end function weld(p,E,u)local z,a={}local function X(p)for p,E in pairs(p:GetChildren())do if E:IsA("\066\097\115\101\080\097\114\116")then if a then local p=Instance.new("\087\101\108\100")p.Name="\087\101\108\100"p.Part0,p.Part1=a,E p.C0=a.CFrame:inverse()p.C1=E.CFrame:inverse()p.Parent=a end a=E table.insert(z,E)end X(E)end end X(p)for p,z in pairs(z)do z.Anchored=E z.CanCollide=u end end wait(1)for p,E in pairs(script.Parent:GetChildren())do if E:FindFirstChild("\087\101\108\100")then E.Weld:Destroy()end end convertSizeToScale(parts_table)weld(script.Parent,true,false)
-- its best to anchor while welding, and then unanchor when finished

parts_table = script.Parent:GetChildren()

round = function(num)
	local a, b = math.modf(num)
	if num % 1 ~= 0 then
		return math.floor(num) + math.floor(b * 10) / 10
	else
		return math.floor(num)
	end
end

function convertSizeToScale(t)
	for i, v in pairs(t) do
		if v:IsA("BasePart") then
			if v:findFirstChild("Mesh") then
				if not v.Size == Vector3.new(0.2, 0.2, 0.2) then
					local vm = v.Mesh
					local vsize = v.Size
					local vscale = vm.Scale

					local percx = vsize.X / vscale.X
					local percy = vsize.Y / vscale.Y
					local percz = vsize.Z / vscale.Z

					local vtotalsize = Vector3.new(0, 0, 0)

					if round(v.Size.X * 10) / 10 ~= 0.2 then
						print(v.Name, v.Size.X)
						vtotalsize = vtotalsize + Vector3.new(percx * 5, 0, 0)
					else
						vtotalsize = vtotalsize + Vector3.new(vm.Scale.X, 0, 0)
					end
					if round(v.Size.Y * 10) / 10 ~= 0.2 then
						vtotalsize = vtotalsize + Vector3.new(0, percy * 5, 0)
					else
						vtotalsize = vtotalsize + Vector3.new(0, vm.Scale.Y, 0)
					end
					if round(v.Size.Z * 10) / 10 ~= 0.2 then
						vtotalsize = vtotalsize + Vector3.new(0, 0, percz * 5)
					else
						vtotalsize = vtotalsize + Vector3.new(0, 0, vm.Scale.Z)
					end

					local prevc = v.CFrame

					v.Size = Vector3.new(0.2, 0.2, 0.2)
					v.CFrame = prevc
					vm.Scale = vtotalsize
				end
			end
		end
	end
end

function weld(modelgroup, anchored, cancollide)
	local parts, last = {}
	local function scan(parent)
		for _, v in pairs(parent:GetChildren()) do
			if v:IsA("BasePart") then
				if last then
					local w = Instance.new("Weld")
					w.Name = "Weld"
					w.Part0, w.Part1 = last, v
					w.C0 = last.CFrame:inverse()
					w.C1 = v.CFrame:inverse()
					w.Parent = last
				end
				last = v
				table.insert(parts, v)
			end
			scan(v)
		end
	end
	scan(modelgroup)
	for _, v in pairs(parts) do
		v.Anchored = anchored
		v.CanCollide = cancollide
	end
end

wait(1)
for i, v in pairs(script.Parent:GetChildren()) do
	if v:FindFirstChild("Weld") then
		v.Weld:Destroy()
	end
end
convertSizeToScale(parts_table)
weld(script.Parent, true, false)
