# Saving Cartune Settings

The `dh_cartune` script provides two exports that allow you to save and apply vehicle tuning settings:

```lua
local tune = exports["dh_cartune"]:getVehicleTune(plate)
exports["dh_cartune"]:setVehicleTune(plate, tune)
```

This is especially useful when storing vehicles in a garage. Typically, vehicle properties should be saved when storing the vehicle and applied when retrieving it.

#### Example Usage

**Storing a Vehicle**

When storing a vehicle, retrieve and save its tuning settings:

```lua
local vehicleProperties = GetVehicleData(vehicle) -- function from garage script
local plate = GetVehicleNumberPlateText(vehicle)
local tune = exports["dh_cartune"]:getVehicleTune(plate)
vehicleProperties.tune = tune
```

**Retrieving a Vehicle**

When retrieving a vehicle, apply the saved tuning settings:

```lua
local vehicleProperties = GetVehicleData(vehicle) -- function from garage script
local plate = GetVehicleNumberPlateText(vehicle)
exports["dh_cartune"]:setVehicleTune(plate, vehicleProperties.tune)
```

This ensures that the vehicle maintains its custom tuning when it is taken out of storage.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devhub.gg/car-tune/saving-cartune-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
