Page cover

⚙️Configuration

This guide covers the configurable options for the NeedForScripts Customs Script and provides information on available events and exports for integration with other scripts.

Configurable Options

The main configuration file is config.lua. Here are the key aspects you can modify:

  1. Prices: Adjust the costs for various customization options.

  2. Categories: Modify the available customization categories to suit your server's needs.

  3. Images: Set custom images for different parts of the user interface.

  4. Camera Angles: Configure camera positions for various customization views.

  5. Tuner Shop Locations: Set the locations where players can access the customization features.

  6. Blips: Adjust settings for map blips, including whether to display them.

  7. Job Restrictions: Configure which jobs are allowed to access the customization features.

  8. Translations: Customize text displayed in the script to support multiple languages.

For detailed information on how to adjust these settings, please refer to the comments in the config.lua file.

Events

Client Event

AddEventHandler('nfs-customs:client:customsToggle', function(show)
    -- Your code here
end)

This event is triggered when the customs UI is opened or closed. The show parameter is a boolean indicating if the UI is being shown (true) or hidden (false).

Server Event

RegisterNetEvent('nfs-customs:server:customsToggle', function(show)
    -- Your code here
end)

This event is triggered on the server when a player opens or closes the customs UI. The show parameter works the same as in the client event.

Exports

toggleCustoms

exports['nfs-customs']:toggleCustoms(show)

Use this export to programmatically open or close the customs UI.

  • show: boolean - Set to true to open the UI, false to close it.

Get specified vehicle stancers

local data = exports['nfs-customs']:getVehicleStancers(vehicleEntity)

Set specified vehicle stancers

exports['nfs-customs']:setVehicleStancers(vehicleEntity, data)

Integration Tips

  1. Use the provided events to sync other scripts with the customs UI state.

  2. Adjust job restrictions to integrate with your server's job system.

  3. Customize blip settings to match your server's map style.

  4. Use translations to support multiple languages on your server.

Remember to restart your server after making changes to the configuration file.

For more detailed information on each configuration option, please refer to the comments in the config.lua file.

Last updated