car=script.Parent.Parent Base=car:FindFirstChild("\066\097\115\101")Left=car:FindFirstChild("\076\101\102\116")Right=car:FindFirstChild("\082\105\103\104\116")for H,o in pairs(car:GetChildren())do if o:IsA("\077\111\116\111\114")then o:Destroy()end end if Base then if Left then leftMotor=Instance.new("\077\111\116\111\114\054\068",car)leftMotor.Name="\076\101\102\116\077\111\116\111\114"leftMotor.Part0=Left leftMotor.Part1=Base leftMotor.C0=CFrame.new(-WheelSize/2-Left.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,-math.pi/2)leftMotor.C1=CFrame.new((Base.Size.x/2+Left.Size.x)+WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)leftMotor.MaxVelocity=motorSpeed end if Right then rightMotor=Instance.new("\077\111\116\111\114\054\068",car)rightMotor.Name="\082\105\103\104\116\077\111\116\111\114"rightMotor.Part0=Right rightMotor.Part1=Base rightMotor.C0=CFrame.new(-WheelSize/2-Right.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)rightMotor.C1=CFrame.new((-Base.Size.x/2-Right.Size.x)-WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)rightMotor.MaxVelocity=motorSpeed end end

car = script.Parent.Parent

Base = car:FindFirstChild("Base")
Left = car:FindFirstChild("Left")
Right = car:FindFirstChild("Right")

for _,h in pairs (car:GetChildren()) do
	if h:IsA("Motor") then--make sure we start with a blank slate
		h:Destroy()
	end
end


if Base then
	if Left then
		leftMotor = Instance.new("Motor6D", car)
		leftMotor.Name = "LeftMotor"
		leftMotor.Part0 = Left
		leftMotor.Part1 = Base
		leftMotor.C0 = CFrame.new(-WheelSize/2-Left.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,-math.pi/2)
		leftMotor.C1 = CFrame.new(Base.Size.x/2+Left.Size.x+WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)
		leftMotor.MaxVelocity = motorSpeed
	end
	if Right then
		rightMotor = Instance.new("Motor6D", car)
		rightMotor.Name = "RightMotor"
		rightMotor.Part0 = Right
		rightMotor.Part1 = Base
		rightMotor.C0 = CFrame.new(-WheelSize/2-Right.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)
		rightMotor.C1 = CFrame.new(-Base.Size.x/2-Right.Size.x-WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)
		rightMotor.MaxVelocity = motorSpeed
	end
end
