ConfigurationConfiguration

Configuration

The resource includes a configurable config.lua file that allows you to customize how the script operates on your FiveM server.

To modify the settings, open config.lua in a text editor, such as Visual Studio Code or Notepad++, and adjust the available options to your preferences.

Configuration Example

local Config = {

    defaultKey = 'k', -- Default keybind

    driverOnly = false, -- Only the driver can use it

    doors = { 0, 1 }, -- 0 = Front Left, 1 = Front Right

}

Configuration Options

1. defaultKey

defaultKey = 'k',

Sets the default keyboard key used to activate the resource.

  • 'k' – Uses the K key.
  • You can change this value to another supported keyboard key.
  • Players can use the configured key to activate the resource.

2. driverOnly

driverOnly = false,

Determines whether the resource can only be used by the vehicle's driver.

  • false – Allows any occupant to use the functionality.
  • true – Restricts usage to the driver only.

3. doors

doors = { 0, 1 },

Determines which vehicle doors are controlled by the resource.

Door IDVehicle Door
0Front Left
1Front Right
2Rear Left
3Rear Right
4Hood
5Trunk

You can modify the list to control different doors.

Examples:

Front doors only:

doors = { 0, 1 },

Rear doors only:

doors = { 2, 3 },

All four passenger doors:

doors = { 0, 1, 2, 3 },

All doors, including hood and trunk:

doors = { 0, 1, 2, 3, 4, 5 },

Saving Your Configuration

  1. Make your desired changes inside config.lua.
  2. Save the file.
  3. Restart the resource using your server console:
restart resource-name

4. Join your server and test the updated settings.

Important: Make sure your configuration follows the Lua syntax shown in the examples. Incorrect syntax or unsupported values may prevent the resource from working correctly.

Was this page helpful?