function Steering()if _MSteer then local a=math.max(1,(mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth)/200)local n=_Tune.Peripherals.MSteerDZone/100 local t=(mouse.X-mouse.ViewSizeX/2)/a if math.abs(t)<=n then _GSteerT=0 else _GSteerT=(math.max(math.min(math.abs(t)-n,1-n),0)/(1-n))^_Tune.MSteerExp*(t/math.abs(t))end end if _GSteerC<_GSteerT then if _GSteerC<0 then _GSteerC=math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)else _GSteerC=math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)end else if _GSteerC>0 then _GSteerC=math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)else _GSteerC=math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)end end local a=1-math.min(car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude/_Tune.SteerDecay,1-_Tune.MinSteer/100)for n,t in pairs(car.Wheels:GetChildren())do if t.Name=="\070"then t.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad((_GSteerC*_Tune.SteerInner)*a),0)elseif t.Name=="\070\076"then if _GSteerC>=0 then t.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad((_GSteerC*_Tune.SteerOuter)*a),0)else t.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad((_GSteerC*_Tune.SteerInner)*a),0)end elseif t.Name=="\070\082"then if _GSteerC>=0 then t.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad((_GSteerC*_Tune.SteerInner)*a),0)else t.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad((_GSteerC*_Tune.SteerOuter)*a),0)end end end end
--[[Steering]]

function Steering()
	--Mouse Steer
	if _MSteer then
		local msWidth = math.max(1, mouse.ViewSizeX * _Tune.Peripherals.MSteerWidth / 200)
		local mdZone = _Tune.Peripherals.MSteerDZone / 100
		local mST = ((mouse.X - mouse.ViewSizeX / 2) / msWidth)
		if math.abs(mST) <= mdZone then
			_GSteerT = 0
		else
			_GSteerT = (math.max(math.min((math.abs(mST) - mdZone), (1 - mdZone)), 0) / (1 - mdZone)) ^ _Tune.MSteerExp
				* (mST / math.abs(mST))
		end
	end

	--Interpolate Steering
	if _GSteerC < _GSteerT then
		if _GSteerC < 0 then
			_GSteerC = math.min(_GSteerT, _GSteerC + _Tune.ReturnSpeed)
		else
			_GSteerC = math.min(_GSteerT, _GSteerC + _Tune.SteerSpeed)
		end
	else
		if _GSteerC > 0 then
			_GSteerC = math.max(_GSteerT, _GSteerC - _Tune.ReturnSpeed)
		else
			_GSteerC = math.max(_GSteerT, _GSteerC - _Tune.SteerSpeed)
		end
	end

	--Steer Decay Multiplier
	local sDecay = (
		1 - math.min(
			car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude / _Tune.SteerDecay,
			1 - (_Tune.MinSteer / 100)
		)
	)

	--Apply Steering
	for i, v in pairs(car.Wheels:GetChildren()) do
		if v.Name == "F" then
			v.Arm.Steer.CFrame = car.Wheels.F.Base.CFrame
				* CFrame.Angles(0, -math.rad(_GSteerC * _Tune.SteerInner * sDecay), 0)
		elseif v.Name == "FL" then
			if _GSteerC >= 0 then
				v.Arm.Steer.CFrame = car.Wheels.FL.Base.CFrame
					* CFrame.Angles(0, -math.rad(_GSteerC * _Tune.SteerOuter * sDecay), 0)
			else
				v.Arm.Steer.CFrame = car.Wheels.FL.Base.CFrame
					* CFrame.Angles(0, -math.rad(_GSteerC * _Tune.SteerInner * sDecay), 0)
			end
		elseif v.Name == "FR" then
			if _GSteerC >= 0 then
				v.Arm.Steer.CFrame = car.Wheels.FR.Base.CFrame
					* CFrame.Angles(0, -math.rad(_GSteerC * _Tune.SteerInner * sDecay), 0)
			else
				v.Arm.Steer.CFrame = car.Wheels.FR.Base.CFrame
					* CFrame.Angles(0, -math.rad(_GSteerC * _Tune.SteerOuter * sDecay), 0)
			end
		end
	end
end
