--[[Flip]]


	function Flip()
		--Detect Orientation
		if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
			FlipWait=tick()
			
		--Apply Flip
		else
			if tick()-FlipWait>=3 then
				FlipDB=true
				local gyro = car.DriveSeat.Flip
				gyro.maxTorque = Vector3.new(10000,0,10000)
				gyro.P=3000
				gyro.D=500
				wait(1)
				gyro.maxTorque = Vector3.new(0,0,0)
				gyro.P=0
				gyro.D=0
				FlipDB=false
			end
		end
	end

game:GetService("RunService").RenderStepped:connect(function()
	if script.Parent.AssistantBrake.Value == true and _CGear ~= -1 and _SteerL == false and _SteerR == false then
		RBrakeForce = _Tune.RBrakeForce
		FBrakeForce = _Tune.FBrakeForce
		_GBrake = 1
		script.Parent.Lights.Value:FireServer({["EnableBrakes"]=true})
		if script.Parent.AssistantAlarm.IsPlaying == false then
			script.Parent.AssistantAlarm:Play()
		end
		script.Parent["AC6_Stock_Gauges"].EBrake.Visible = true
		script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
		wait(3.5)
		script.Parent["AC6_Stock_Gauges"].EBrake.Visible = false
		_GBrake = 0
		script.Parent.Lights.Value:FireServer({["DisableBrakes"]=true})
	elseif _CGear == -1 and script.Parent.AssistantBrake.Value == true then
		script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
	elseif (_SteerL == true or _SteerR == true) and script.Parent.AssistantBrake.Value == true then
		script.Parent.FEAssistantBrake.DisableAssistantBrake:FireServer()
	end
end)
