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:
ps-scriptname/├── shared/│ └── config.lua <- Main config file└── config.lua <- Alternative locationBasic Structure
Every config file starts with a Config table:
Config = {}
-- Framework selectionConfig.Framework = 'qb-core'
-- Debug modeConfig.Debug = false
-- Feature togglesConfig.Features = { EnableFeatureA = true, EnableFeatureB = false,}Common Options
Framework Selection
-- Supported frameworksConfig.Framework = 'qb-core' -- QBCoreConfig.Framework = 'qbox' -- QBoxConfig.Framework = 'esx' -- ESX LegacyDebug Mode
Enable for troubleshooting:
Config.Debug = true -- Shows debug prints in consoleAlways disable debug mode in production for better performance.
Job/Permission Settings
Config.RequiredJob = 'police'Config.RequiredGrade = 2Config.AllowedJobs = {'police', 'sheriff', 'fbi'}Locale/Language
Config.Locale = 'en' -- Check locales/ folder for optionsAdvanced Configuration
Cooldowns and Timers
Config.Cooldowns = { ActionCooldown = 30, -- seconds GlobalCooldown = 300, -- seconds}Position/Location Data
Config.Locations = { { coords = vector3(123.45, -456.78, 29.0), heading = 90.0, label = "Location Name" },}Item Rewards
Config.Rewards = { {item = 'money', min = 100, max = 500}, {item = 'weapon_pistol', chance = 0.1},}Environment Variables
For sensitive data, use convars:
-- 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:
ensure ps-scriptnameSome changes require a full server restart, such as:
- Database schema changes
- New convar definitions
- Framework changes
Best Practices
- Backup configs before updating scripts
- Document your changes with comments
- Test on a development server first
- Use version control for config files
-- MODIFIED: Increased cooldown for our serverConfig.Cooldown = 60 -- Default was 30Troubleshooting Config Issues
Syntax Errors
-- Wrong: Missing commaConfig.Options = { OptionA = true OptionB = false}
-- CorrectConfig.Options = { OptionA = true, OptionB = false,}Type Mismatches
-- Wrong: String instead of numberConfig.Cooldown = "30"
-- CorrectConfig.Cooldown = 30Missing 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
