Frameworkcrash
attempt to index a nil value (global 'QBCore')
Also seen as: QBCore nil global QBCore not defined GetCoreObject nil
What causes it
The QBCore object is nil — you used it before assigning it, or qb-core isn't started before your resource. The correct pattern is exports['qb-core']:GetCoreObject().
How to fix it
Assign QBCore via the export and ensure qb-core starts first.
- At the top of your files: local QBCore = exports['qb-core']:GetCoreObject().
- In server.cfg, ensure qb-core before dependent resources.
- Check qb-core itself started without errors.
- Watch for a typo in the export name.
Related errors
Related guides
Still stuck? We can help.
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.