qbcore-framework / qb-inventory

Slot Based Inventory System Used With QB-Core :school_satchel:
GNU General Public License v3.0
49 stars 376 forks source link

[SUGGESTION] Crafting reward qty #444

Closed nzkfc closed 10 months ago

nzkfc commented 1 year ago

The problem

Currently crafting an item gives you 1 quantity. This might be ok for an RP crafting setup that doesn't go too deep, but if you ever want to gate some levels with grind you can't make the craft side easier by returning more reward.

Ideal solution

A function in the config to add how many items of what they're crafting they get on completion, instead of just one.

NFI but something like this I guess: Config.CraftingItems = { [1] = { name = "lockpick", amount = 50, info = {}, costs = { ["metalscrap"] = 22, ["plastic"] = 32, }, reward = 1, type = "item", slot = 1, threshold = 0, points = 1, }, }

Means you could also do: reward = math.random(1,3),

Or similar.

Alternative solutions

From the looks of it, the value of 1 is set in the code when items are being given, so in my limited LUA knowledge I assume that 1 can be replaced with something that looks up the craft reward item in the config and gets that value.

Additional context

No response

github-actions[bot] commented 11 months ago

This issue has had 60 days of inactivity & will close within 7 days