local V,s={}local j=false local l=false function scan(b)for v,Z in pairs(b:GetChildren())do if b.Name=="\083\117\115\112\101\110\115\105\111\110"then j=true end if b.Parent.Name=="\087\104\101\101\108\115"then l=true end if Z:IsA("\066\097\115\101\080\097\114\116")or Z:IsA("\085\110\105\111\110\079\112\101\114\097\116\105\111\110")or Z:IsA("\083\101\097\116")or Z:IsA("\086\101\104\105\099\108\101\083\101\097\116")or Z:IsA("\077\101\115\104\080\097\114\116")then if s and not j then local V=Instance.new("\087\101\108\100")V.Part0,V.Part1=s,Z V.C0=(Z.CFrame:toObjectSpace(s.CFrame)):inverse()V.Parent=s end table.insert(V,Z)s=Z end scan(Z)end end scan(script.Parent)if j then local V=script:Clone()local s=script:Clone()V.Parent=script.Parent.RL s.Parent=script.Parent.RR end for V,s in pairs(V)do if not l or l and s.Name~="\087\104\101\101\108"then s.CustomPhysicalProperties=PhysicalProperties.new(.01,0,0,0,0)s.CanCollide=false elseif l and s.Name=="\087\104\101\101\108"then s.CustomPhysicalProperties=PhysicalProperties.new(.2,.7,.5,1,1)else s.CustomPhysicalProperties=PhysicalProperties.new(.7,1,.5,1,1)end end for V,s in pairs(V)do s.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

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
