Configuration

Understanding and customizing script configuration files

All Possible Scripts resources come with configuration files that allow you to customize behavior without modifying core code.

Config File Location

Configuration files are typically found in:

Text
ps-scriptname/├── shared/│   └── config.lua    <- Main config file└── config.lua        <- Alternative location

Basic Structure

Every config file starts with a Config table:

Lua
Config = {}
-- Framework selectionConfig.Framework = 'qb-core'
-- Debug modeConfig.Debug = false
-- Feature togglesConfig.Features = {    EnableFeatureA = true,    EnableFeatureB = false,}

Common Options

Framework Selection

Lua
-- Supported frameworksConfig.Framework = 'qb-core'  -- QBCoreConfig.Framework = 'qbox'     -- QBoxConfig.Framework = 'esx'      -- ESX Legacy

Debug Mode

Enable for troubleshooting:

Lua
Config.Debug = true  -- Shows debug prints in console

Note

Always disable debug mode in production for better performance.

Job/Permission Settings

Lua
Config.RequiredJob = 'police'Config.RequiredGrade = 2Config.AllowedJobs = {'police', 'sheriff', 'fbi'}

Locale/Language

Lua
Config.Locale = 'en'  -- Check locales/ folder for options

Advanced Configuration

Cooldowns and Timers

Lua
Config.Cooldowns = {    ActionCooldown = 30,      -- seconds    GlobalCooldown = 300,     -- seconds}

Position/Location Data

Lua
Config.Locations = {    {        coords = vector3(123.45, -456.78, 29.0),        heading = 90.0,        label = "Location Name"    },}

Item Rewards

Lua
Config.Rewards = {    {item = 'money', min = 100, max = 500},    {item = 'weapon_pistol', chance = 0.1},}

Environment Variables

For sensitive data, use convars:

Lua
-- In configConfig.WebhookURL = GetConvar('ps_webhook', '')
-- In server.cfgset ps_webhook "https://discord.com/api/webhooks/..."

Hot Reloading

Most config changes apply after resource restart:

Text
ensure ps-scriptname

Some changes require a full server restart, such as:

  • Database schema changes
  • New convar definitions
  • Framework changes

Best Practices

  1. Backup configs before updating scripts
  2. Document your changes with comments
  3. Test on a development server first
  4. Use version control for config files
Lua
-- MODIFIED: Increased cooldown for our serverConfig.Cooldown = 60  -- Default was 30

Troubleshooting Config Issues

Syntax Errors

Lua
-- Wrong: Missing commaConfig.Options = {    OptionA = true    OptionB = false}
-- CorrectConfig.Options = {    OptionA = true,    OptionB = false,}

Type Mismatches

Lua
-- Wrong: String instead of numberConfig.Cooldown = "30"
-- CorrectConfig.Cooldown = 30

Missing Required Fields

Check the default config for all required fields. Missing fields often cause errors.

Need Help?

  • Check the script-specific documentation
  • Search our Discord for similar questions
  • Ask in #support with your config file
JDB-NET Logo
Partner Service

Self-hosted unlimited logs with managed Grafana

JDB-NET provides a self-hosted solution with unlimited logs, a fully managed Grafana instance, and unlimited users. Perfect for FiveM servers that need comprehensive logging and monitoring.

Check out JDB-NET