local P,N={}local X=false local d=false function scan(C)for r,a in pairs(C:GetChildren())do if C.Name=="\083\117\115\112\101\110\115\105\111\110"then X=true end if C.Parent.Name=="\087\104\101\101\108\115"then d=true end if a:IsA("\066\097\115\101\080\097\114\116")or a:IsA("\085\110\105\111\110\079\112\101\114\097\116\105\111\110")or a:IsA("\083\101\097\116")or a:IsA("\086\101\104\105\099\108\101\083\101\097\116")or a:IsA("\077\101\115\104\080\097\114\116")then if N and not X then local P=Instance.new("\087\101\108\100")P.Part0,P.Part1=N,a P.C0=(a.CFrame:toObjectSpace(N.CFrame)):inverse()P.Parent=N end table.insert(P,a)N=a end scan(a)end end scan(script.Parent)if X then local P=script:Clone()local N=script:Clone()P.Parent=script.Parent.RL N.Parent=script.Parent.RR end for P,N in pairs(P)do if not d or d and N.Name~="\087\104\101\101\108"then N.CustomPhysicalProperties=PhysicalProperties.new(.01,0,0,0,0)N.CanCollide=false elseif d and N.Name=="\087\104\101\101\108"then N.CustomPhysicalProperties=PhysicalProperties.new(.2,.7,.5,1,1)else N.CustomPhysicalProperties=PhysicalProperties.new(.7,1,.5,1,1)end end for P,N in pairs(P)do N.Anchored=true end if script.Parent.Name=="\083\117\115\112\101\110\115\105\111\110"then script.PATCHER.Parent=script.Parent.Parent script.Parent.Parent.PATCHER.Disabled=false end
--wait(120)
local all, last = {}
local isSusp = false
local isWheel = false
function scan(p)
	for _, v in pairs(p:GetChildren()) do
		if p.Name == "Suspension" then
			isSusp = true
		end
		if p.Parent.Name == "Wheels" then
			isWheel = true
		end
		if
			v:IsA("BasePart")
			or v:IsA("UnionOperation")
			or v:IsA("Seat")
			or v:IsA("VehicleSeat")
			or v:IsA("MeshPart")
		then
			if last and not isSusp then
				local w = Instance.new("Weld")
				w.Part0, w.Part1 = last, v
				w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
				w.Parent = last
			end
			table.insert(all, v)
			last = v
		end
		scan(v)
	end
end
scan(script.Parent)

if isSusp then
	local c1 = script:Clone()
	local c2 = script:Clone()
	c1.Parent = script.Parent.RL
	c2.Parent = script.Parent.RR
end
for _, v in pairs(all) do
	if (not isWheel) or (isWheel and v.Name ~= "Wheel") then
		v.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0)
		v.CanCollide = false
	elseif isWheel and v.Name == "Wheel" then
		v.CustomPhysicalProperties = PhysicalProperties.new(0.2, 0.7, 0.5, 1, 1)
	else
		v.CustomPhysicalProperties = PhysicalProperties.new(0.7, 1, 0.5, 1, 1) --to change to vehicle weight
	end
end

for _, v in pairs(all) do
	v.Anchored = true
end

if script.Parent.Name == "Suspension" then
	script.PATCHER.Parent = script.Parent.Parent
	script.Parent.Parent.PATCHER.Disabled = false
end
