function weld(J,F,P)local T,Z={}local function k(J)for J,F in pairs(J:GetChildren())do if F:IsA("\066\097\115\101\080\097\114\116")then if Z then local J=Instance.new("\087\101\108\100")J.Name="\087\101\108\100"J.Part0,J.Part1=Z,F J.C0=Z.CFrame:inverse()J.C1=F.CFrame:inverse()J.Parent=Z end Z=F table.insert(T,F)end k(F)end end k(J)for J,T in pairs(T)do T.Anchored=F T.CanCollide=P end end weld(script.Parent,true,false)

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

weld(script.Parent,true,false)