Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Question attempt to index a nil value (global 'QBCore')

Bone

Bronze Elite
Joined
Aug 27, 2022
Messages
12
Reaction score
16
Points
166
Location
Holland
Tried for hours but don't know how to fix this. Anyone that could take a look at this? Im using QBCore.

[script:qb-bankrobber] Error loading script server/server.lua in resource qb-bankrobbery: @qb-bankrobbery/server/server.lua:9: attempt to index a nil value (global 'QBCore').

This is the line:

QBCore.Functions.CreateCallback("qb-bankrobbery:server:get:status", function(source, cb)
cb(IsBankBeingRobbed)
end)

Would appreciate some help alot.
 

ishowslow

Bronze Elite
Joined
Jul 31, 2022
Messages
10
Reaction score
4
Points
156
Location
Springfield
Tried for hours but don't know how to fix this. Anyone that could take a look at this? Im using QBCore.

[script:qb-bankrobber] Error loading script server/server.lua in resource qb-bankrobbery: @qb-bankrobbery/server/server.lua:9: attempt to index a nil value (global 'QBCore').

This is the line:

QBCore.Functions.CreateCallback("qb-bankrobbery:server:get:status", function(source, cb)
cb(IsBankBeingRobbed)
end)

Would appreciate some help alot.
Anytime some error like 'Attempt to index a nil value (global 'QBCore') , you can utilize this sequence of code.

At the very top of the script - in your case it is the server.lua for your bankrobbery place this line:

local QBCore = exports['qb-core']:GetCoreObject()

then save the file and try to restart. If done correctly the script should work fine.
 

Bone

Bronze Elite
Joined
Aug 27, 2022
Messages
12
Reaction score
16
Points
166
Location
Holland
Anytime some error like 'Attempt to index a nil value (global 'QBCore') , you can utilize this sequence of code.

At the very top of the script - in your case it is the server.lua for your bankrobbery place this line:

local QBCore = exports['qb-core']:GetCoreObject()

then save the file and try to restart. If done correctly the script should work fine.
It worked! Thanks alot! :)
 

dayjbday

Bronze Elite
Joined
Jun 28, 2022
Messages
12
Reaction score
9
Points
166
Location
America
Anytime some error like 'Attempt to index a nil value (global 'QBCore') , you can utilize this sequence of code.

At the very top of the script - in your case it is the server.lua for your bankrobbery place this line:

local QBCore = exports['qb-core']:GetCoreObject()

then save the file and try to restart. If done correctly the script should work fine.
had this issue with a different script and the same fix worked. thanks!
 

Seal6

Member
Joined
Jan 18, 2022
Messages
11
Reaction score
0
Points
166
Location
United States
I'm Using QBCore, Anyone have any idea what can be causing this?? it seems similar to what you guy were running into..
 

Attachments

  • ps-methrun global error.png
    ps-methrun global error.png
    60.5 KB · Views: 517
  • ps-methrun2.png
    ps-methrun2.png
    40.8 KB · Views: 542
Last edited:

Chaotic24

Member
Joined
May 26, 2023
Messages
1
Reaction score
0
Points
146
Location
california
I use qbcore and when I try to access my armory with third eye this pops up
SCRIPT ERROR: @qb-policejob/client/job.lua:478: attempt to index a nil value (global 'Config')
handler^7 (^5@qb-policejob/client/job.lua^7:478)
fn^7 (^5@qb-target/client.lua^7:1160)
can anyone help me?
 

vasticrat

Silver Elite
Joined
Jan 3, 2025
Messages
46
Reaction score
7
Points
156
Location
eeee
Tried for hours but don't know how to fix this. Anyone that could take a look at this? Im using QBCore.

[script:qb-bankrobber] Error loading script server/server.lua in resource qb-bankrobbery: @qb-bankrobbery/server/server.lua:9: attempt to index a nil value (global 'QBCore').

This is the line:

QBCore.Functions.CreateCallback("qb-bankrobbery:server:get:status", function(source, cb)
cb(IsBankBeingRobbed)
end)

Would appreciate some help alot.
rf
 
Top