> For the complete documentation index, see [llms.txt](https://crimvex-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://crimvex-studio.gitbook.io/docs/scripts/crimvex-rental/fuel-system-integration.md).

# Fuel System Integration

Crimvex Rental supports multiple fuel systems, allowing rented vehicles to spawn with a predefined fuel level.

The fuel integration can be configured in two files:

* `shared/config.lua`
* `client/editableFuel.lua`

***

## Supported Fuel Systems

Currently supported:

| Fuel Script        | Configuration Value |
| ------------------ | ------------------- |
| LegacyFuel         | `"LegacyFuel"`      |
| ox\_fuel           | `"ox_fuel"`         |
| Custom Fuel Script | `"custom"`          |

***

## Selecting a Fuel System

Open:

```
shared/config.lua
```

Set your preferred fuel system.

### LegacyFuel

```lua
Config.FuleSystem = "LegacyFuel"
```

***

### ox\_fuel

```lua
Config.FuleSystem = "ox_fuel"
```

***

### Custom Fuel Script

```lua
Config.FuleSystem = "custom"
```

When using `"custom"`, you must edit:

```
client/editableFuel.lua
```

***

## Default Fuel Level

Every rental vehicle spawns with the following fuel level:

```lua
local fuelValue = 65
```

The value ranges from:

```
0 - 100
```

Example:

```lua
local fuelValue = 100
```

Every rented vehicle will spawn with a full tank.

***

## Adding a Custom Fuel Script

If your server uses a fuel script that is not officially supported, simply select:

```lua
Config.FuleSystem = "custom"
```

Then edit:

```
client/editableFuel.lua
```

Inside the custom section:

```lua
elseif cfg.FuleSystem == "custom" then
    -- Add Your Custom Fuel Export or Code Here
```

Replace the placeholder with your own fuel export.

Example:

```lua
elseif cfg.FuleSystem == "custom" then
    exports["your-fuel-script"]:SetFuel(vehicle, fuelValue)
end
```

> Replace `your-fuel-script` with the export provided by your fuel resource.

***

## LegacyFuel Example

```lua
Config.FuleSystem = "LegacyFuel"
```

No additional configuration is required.

***

## ox\_fuel Example

```lua
Config.FuleSystem = "ox_fuel"
```

No additional configuration is required.

***

## Tips

✅ Make sure only one fuel system is selected.

✅ Verify your chosen fuel resource is installed and running.

✅ Test the fuel level after renting a vehicle.

✅ If you use a custom fuel script, ensure the export name matches your resource.

***

## Common Issues

### Fuel is not applied

Check the following:

* The correct fuel system is selected in `shared/config.lua`.
* The fuel resource is started before `crimvex-rental`.
* Your custom export name is correct.
* The vehicle entity exists before applying fuel.

***

### Custom fuel script does not work

Make sure you have added your fuel script's export inside:

```
client/editableFuel.lua
```

and selected:

```lua
Config.FuleSystem = "custom"
```

***

## Next Step

Continue to **🔐 Secrets Configuration** to configure your Discord Bot, Guild ID, VIP Role IDs, and Discord webhooks.
