if script.Parent.Storage.EngineType.Value~="\069\108\101\099\116\114\105\099"then if script.Parent.Storage.TransmissionType.Value=="\072\080\097\116\116\101\114\110"then if currentgear.Value==3 and clutch.Value==true then else end elseif script.Parent.Storage.TransmissionType.Value=="\065\117\116\111\109\097\116\105\099"then elseif script.Parent.Storage.TransmissionType.Value=="\068\117\097\108\067\108\117\116\099\104"then elseif script.Parent.Storage.TransmissionType.Value=="\067\086\084"then vvv=.034 vt=.7 if rpm.Value>=5000*convert and throttle.Value>=1 then if gear1.Value>.7 and speed>40 then gear1.Value=gear1.Value-.02*(2-speed/130)elseif gear1.Value<.5 then gear1.Value=.5 end elseif rpm.Value<=4900*convert then if gear1.Value>4 then gear1.Value=4 else gear1.Value=gear1.Value+.028*(2-speed/130)end end end end if script.Parent.Storage.Brake.Value>.2 then drive=((((((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/8 else if carSeat.Dyno.Value==false then if script.Parent.Storage.Drivetrain.Value=="\082\087\068"then drive=((((((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/8)+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/8 orderch=((carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude)/2)*1.298 TC=rt torquesplit.Value=100 elseif script.Parent.Storage.Drivetrain.Value=="\070\087\068"then drive=carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/2+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/2 orderch=((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude)/2)*1.298 torquesplit.Value=0 TC=ft elseif script.Parent.Storage.Drivetrain.Value=="\065\087\068"then drive=carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/2+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/2 orderch=((((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude)+carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude)+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude)/4)*1.298 TC=(rt+ft)/2 end else if script.Parent.Storage.Drivetrain.Value=="\082\087\068"then drive=carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/2+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/2 elseif script.Parent.Storage.Drivetrain.Value=="\070\087\068"then drive=carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/2+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/2 elseif script.Parent.Storage.Drivetrain.Value=="\065\087\068"then drive=((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/4+carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/4)+carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/4)+carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/4 end end end xxx=(gear[currentgear.Value]/final.Value)*111 ovo=(gear[currentgear.Value]/final.Value)*1.5 trans.Value=drive if currentgear.Value~=1 then x1x=(gear[currentgear.Value-1]/final.Value)*111 xx1=(gear[currentgear.Value+1]/final.Value)*111 else x1x=1 end tran=clutch.Clutch.Value wheelrpm=trans.Value*xxx four=gear[currentgear.Value]/final.Value if script.Parent.Functions.ShiftDownRequested.Value~=true and script.Parent.Functions.ShiftUpRequested.Value~=true then rpm.Value=engine.Value*(1-tran)+tran*wheelrpm end checkcluch=clutch.Clutch.Value if clutch.Value==true then CT=1 else CT=0 end
--{HPattern, Automatic, DualClutch, CVT}
if script.Parent.Storage.EngineType.Value ~= "Electric" then
	if script.Parent.Storage.TransmissionType.Value == "HPattern" then
		if currentgear.Value == 3 and clutch.Value == true then
		--script.Parent.Storage.AutoClutch.Value = true
		else
			--script.Parent.Storage.AutoClutch.Value = false
		end
	elseif script.Parent.Storage.TransmissionType.Value == "Automatic" then
	elseif script.Parent.Storage.TransmissionType.Value == "DualClutch" then
	elseif script.Parent.Storage.TransmissionType.Value == "CVT" then
		vvv = 0.034
		vt = 0.7
		if rpm.Value >= 5000 * convert and throttle.Value >= 1 then
			if gear1.Value > 0.7 and speed > 40 then
				gear1.Value = gear1.Value - 0.02 * (2 - (speed / 130))
			elseif gear1.Value < 0.5 then
				gear1.Value = 0.5
			end
		elseif rpm.Value <= 4900 * convert then
			if gear1.Value > 4 then
				gear1.Value = 4
			else
				gear1.Value = gear1.Value + 0.028 * (2 - (speed / 130))
			end
		end
	end
end

if script.Parent.Storage.Brake.Value > 0.2 then
	drive = (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude / 8)
		+ (carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude / 8)
else
	if carSeat.Dyno.Value == false then
		if script.Parent.Storage.Drivetrain.Value == "RWD" then
			drive = (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude / 8)
				+ (carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude / 8)
			orderch = (
				(
					carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude
					+ carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude
				) / 2
			) * 1.298
			TC = rt
			torquesplit.Value = 100
		elseif script.Parent.Storage.Drivetrain.Value == "FWD" then
			drive = (carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude / 2)
				+ (carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude / 2)
			orderch = (
				(
					carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude
					+ carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude
				) / 2
			) * 1.298
			torquesplit.Value = 0
			TC = ft
		elseif script.Parent.Storage.Drivetrain.Value == "AWD" then
			drive = (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 2)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 2)
			orderch = (
				(
					carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude
					+ carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude
					+ carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude
					+ carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude
				) / 4
			) * 1.298
			TC = (rt + ft) / 2
		end
	else
		if script.Parent.Storage.Drivetrain.Value == "RWD" then
			drive = (carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude / 2)
				+ (carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude / 2)
		elseif script.Parent.Storage.Drivetrain.Value == "FWD" then
			drive = (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 2)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 2)
		elseif script.Parent.Storage.Drivetrain.Value == "AWD" then
			drive = (carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude / 4)
				+ (carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude / 4)
				+ (carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude / 4)
				+ (carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude / 4)
		end
	end
end
xxx = (gear[currentgear.Value] / final.Value) * 111
ovo = (gear[currentgear.Value] / final.Value) * 1.5
trans.Value = drive

if currentgear.Value ~= 1 then
	x1x = (gear[(currentgear.Value - 1)] / final.Value) * 111
	xx1 = (gear[(currentgear.Value + 1)] / final.Value) * 111
else
	x1x = 1
end

tran = clutch.Clutch.Value
wheelrpm = trans.Value * xxx
four = (gear[currentgear.Value] / final.Value)
if
	script.Parent.Functions.ShiftDownRequested.Value ~= true
	and script.Parent.Functions.ShiftUpRequested.Value ~= true
then
	rpm.Value = (engine.Value * (1 - tran)) + (tran * wheelrpm)
end

checkcluch = clutch.Clutch.Value

if clutch.Value == true then
	CT = 1
else
	CT = 0
end
