Combining Items for Multiples. Is it possible?

I’d like to have a way of combining an item like “coke_brick” with a custom made item such as “box_cutter” which would result in say 100x cokebaggy. Currently, the default combinations only yield a single resulting item…I’ve also looked at the QB docs but they don’t explain how to get multiple resulting items. Thank you in advance!

This is an interesting idea, i’ve been working with QBcore and can think of some way you could get this to work.

If you wanted to make the “box_cutter” a usable item you would

QBCore.Functions.CreateUseableItem('box_cutter', function(source, item)
	local src = source
    local Player = QBCore.Functions.GetPlayer(src)	
    TriggerClientEvent('qb-script:client:useboxcut', src, item)
end)

in the server script, and then call in the client an event that check to see if the player has enough “coke_brick”

RegisterNetEvent('qb-script:client:useboxcut', function(item)
	local cokebrick = QBCore.Functions.GetItemByName('coke_brick')
	if cokebrick.amount > 0 then
		TriggerServerEvent('qb-script:server:getcokebags')
	end
end)

and then back in the server script you would remove the “coke_brick” and give 100x of “cokebaggy”

RegisterNetEvent('qb-script:server:getcokebags', function()
	local src = source
    local Player = QBCore.Functions.GetPlayer(src)    
    Player.Functions.RemoveItem("coke_brick", 1)
	Player.Functions.AddItem("cokebaggy", 100)
end)

However, if you wanted the box cutter to be usable on multiple different items like weed brick and meth brick and do the same you would probably need to use a QB-menu and then the menu would do the same as above for each item individually.

Thank you blitz! I will implement the script on my server and test. I’ll make sure to update the thread later with the results.