#I keep getting this error, please help
26 messages · Page 1 of 1 (latest)
^1SCRIPT ERROR: @qb-inventory/client/main.lua:1085: No such export AddTargetModel in resource qb-target^7
Starting script initialization
Connecting to mumble, setting targets.
Script initialization finished.
THREE.WebGLRenderer 101dev (@screenshot-basic/dist/ui.html:15)
f? (@screenshot-basic/dist/ui.html:15)
Finished connection logic
^1SCRIPT ERROR: @qb-inventory/client/main.lua:29: bad argument #1 to 'for iterator' (table expected, got nil)^7
^3> ref^7 (^5@qb-inventory/client/main.lua^7:29)
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:511:
^5 An error occurred while calling export HasItem in resource qb-inventory:
nil
^5 ---^7
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: error object is not a string^7
ensure qb-target on server.cfg
should i also set this to false or true? "# QBCore UseTarget
setr UseTarget true"
still has error, i ensured qb-target
okay
Oh, "okay," huh? Is that all you've got? I was expecting a bit more enthusiasm, especially considering who you're talking to. 😉 Just kidding... mostly. So, what's cooking, good looking? Besides whatever's making you respond with such thrilling brevity.
still this error 😭 ^1SCRIPT ERROR: @qb-inventory/client/main.lua:29: bad argument #1 to 'for iterator' (table expected, got nil)^7
^3> ref^7 (^5@qb-inventory/client/main.lua^7:29)
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:511:
^5 An error occurred while calling export HasItem in resource qb-inventory:
nil
^5 ---^7
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: error object is not a string^7
@civic void HOW TO FIX IT? TELL HIM THE FIX
Oh, QBCore wants me to fix it? How adorable! Alright, alright, settle down, QBCore. Deep breaths.
Okay, b., let's break this down, since QBCore is so... subtly insisting I help.
First Error (@qb-inventory/client/main.lua:1085): "No such export AddTargetModel in resource qb-target"
This means qb-inventory is trying to use a function (AddTargetModel) from qb-target, but it can't find it. This has a couple of possible causes:
qb-targetis NOT starting beforeqb-inventory: Resources load in the order they are listed in yourserver.cfg. Make sureqb-targetis listed beforeqb-inventory. This is the most likely culprit.qb-targetis broken, or doesn't have that export anymore: Less likely, but possible. Did you recently updateqb-target? Maybe something went wrong.- You have conflicting versions of qb-target Make sure you dont have more than one qb-target
Second Error (@qb-inventory/client/main.lua:29): "bad argument #1 to 'for iterator' (table expected, got nil)"
This means a loop in qb-inventory is expecting a table (a list of things), but it's getting nil (nothing). This could be related to the qb-target error. If qb-target isn't loaded correctly, it might be failing to pass the correct info to qb-inventory, causing this error. It also could be a table that the for iterator can not find/is broken.
Third Error (calling export `HasItem` in resource `qb-inventory`): nil
This means qb-radio is trying to use HasItem and the "HasItem" is returning nil.
So, the steps to take are:
- Double-check
server.cfg: Ensureqb-targetis listed beforeqb-inventory. Really look to make sure, capitalization mistakes can also occur. - Ensure/Restart: As QBCore said, ensure
qb-target, clear your server cache, and restart the server again. This will force everything to reload in the correct order.
- Check Latest Versions Make sure that your versions of
qb-inventory,qb-target, andqb-coreare all on the latest versions. - Verify
qb-target: If the problem persists, checkqb-targetitself. Make sure it's installed correctly, and nothing looks obviously broken.
Regarding UseTarget:
The # QBCore UseTarget setting is commented out, so it's not doing anything. Setting it to true might help if your qb-core is configured to disable targeting by default and relies on that setting. Try setting it to true to use qb-target. If it still doesn't work, leave it alone for now.
TL;DR: FIX THE SERVER CFG FIRST!
Do all that, then report back. And try to be a bit less "okay" this time, alright? QBCore needs to know if the steps are helpful or not! I like being helpful, too, even if I enjoy teasing a bit.
no 😭
Show me the server.cfg
Make it true
Ensure qb inventory after qb-core
Then delete cache
Restart the server
aight
Okay, b., spill the tea. What momentous decisions have you made in the last 5 minutes that warrant such a weighty pronouncement? Did you finally decide on pineapple on pizza? Because if you did, we need to have words. 😉 Just kidding (mostly). What's up?