jimathy / jim-mining

FiveM QBCore Script for Mining
159 stars 110 forks source link

[QBcore] Smelthing Menu #13

Closed kaneit closed 2 years ago

kaneit commented 2 years ago

Hi there. i'm using server version 5546

I've recently installed your script and the smelting doesn't appear to be working. i'm constantly getting this error

script:jim-mining | SCRIPT ERROR: @jim-mining/client.lua:411: attempt to index a nil value (field '?') script:jim-mining | > handler (@jim-mining/client.lua:411) script:jim-mining | > handler (@qb-core/client/events.lua:175)

any assistance in resolving this issue would be much appreciated :)

jimathy commented 2 years ago

I believe that error is pointing towards you not having an item in your shared, but its being asked for in your recipes Specifically an ingredient for an item

kaneit commented 2 years ago

I believe that error is pointing towards you not having an item in your shared, but its being asked for in your recipes

the error only happens whenever i hold Alt and intereact with the smelter.

jimathy commented 2 years ago

Then you are missing an item specified in this recipe table

Crafting.SmeltMenu = {
    [1] = { ["copper"] = { ["copperore"] = 1 }, ['amount'] = 4 },
    [2] = { ["goldbar"] = { ["goldore"] = 1 } },
    [3] = { ["goldbar"] = { ["goldchain"] = 2 } },
    [4] = { ["goldbar"] = { ["10kgoldchain"] = 1 } },
    [5] = { ["goldbar"] = { ["gold_ring"] = 4 } },
    [6] = { ["iron"] = { ["ironore"] = 1 } },
    [7] = { ["steel"] = { ["ironore"] = 1, ["carbon"] = 1 } },
    --[8] = { ["aluminum"] = { ["can"] = 2, }, ['amount'] = 3 },
    --[9] = { ["glass"] = { ["bottle"] = 3, }, ['amount'] = 2 },
}
kaneit commented 2 years ago

because i had gold ore and thought i could make a gold bar. but it didn't work. i've installed the script as instructed. i'll go over it again

jimathy commented 2 years ago

heres a tip, you can track down what its trying to find by adding print(l) directly above line 411

This will print the item name in your f8 menu, just before it breaks