--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
