A simple “Combine Items” feature for ox_inventory.
Configure your desired combinations, drag an item onto another and combine them into a result item.
Enjoy
Depedencies: ox_inventory, ox_lib
Github
Preview
UPDATE 1.1
You can now combine, only within your own inventory (no stashes or other players inventories)
You can have multiple result items + configurable amounts.
You can configure if you want items to be removed after combining.
local Combinations = {
-- ['something'] = {
-- needs = 'the other something',
-- result = {
-- [1] = {name = 'some result', amount = 1},
-- --[2] = {name = 'more results', amount = 5},
-- },
-- removeItemA = true, -- Remove the dragged item?
-- removeItemB = true, -- Remove the item you dragged onto?
-- },
['coca'] = {
needs = 'baggy',
result = {
[1] = {name = 'coke', amount = 1},
--[2] = {name = 'something', amount = 5},
},
removeItemA = true, -- Remove the dragged item?
removeItemB = true, -- Remove the item you dragged onto?
},
}
Also, don’t miss our previous releases!
[STANDALONE] Main Menu [GrandRP Inspired]
[ESX] Drug Processing Labs with UI and Level System
[ESX] Create Mafia | Let Players Create Their Own Organisations
[ESX] The Ultimate Gang Wars Script
[ESX] Dark Sales | XP System | Stock System
[ESX] Counterfeit Cash & Laundry
Drug Dealers | Cutscenes | Reputation System
16 Likes
Archxn
April 1, 2023, 9:35am
2
Could you also make the opposite? Splitting items Into two? Good work though!
Can i borrow ur inventory
There really isnt a way in ox to do that, this is possible bc there are invetory hooks
UPDATE 1.1
You can now combine, only within your own inventory (no stashes or other players inventories)
You can have multiple result items + configurable amounts.
You can configure if you want items to be removed after combining.
local Combinations = {
-- ['something'] = {
-- needs = 'the other something',
-- result = {
-- [1] = {name = 'some result', amount = 1},
-- --[2] = {name = 'more results', amount = 5},
-- },
-- removeItemA = true, -- Remove the dragged item?
-- removeItemB = true, -- Remove the item you dragged onto?
-- },
['coca'] = {
needs = 'baggy',
result = {
[1] = {name = 'coke', amount = 1},
--[2] = {name = 'something', amount = 5},
},
removeItemA = true, -- Remove the dragged item?
removeItemB = true, -- Remove the item you dragged onto?
},
}
1 Like
NasM
April 4, 2023, 9:05am
7
Hello , yes it’s work with ox
Thanks for this script! Can you add amount options for the dragged item and needed item?
@Lab_Scripts i got a problem here:
local combhook = ox_inventory:registerHook(‘swapItems’, function(payload)
and it says that cant load the server side of the script
i got an old version of ox, should i update? or maybe you can help me making it compatible?
When i drop the first needed item on the ground it throws this error
refers to the first condition where the payload.toSlot is declared
I dont think that the newest Version make this kind of Problems of almost many Latest, i think he made the Script on his Build even because he got a costum design i dont think that he update ox inventory much.
This Script is so fucking amazing and almost so simple, i hope we get a update soon.
the nice thing is that i’m using all the latest updated ox builds(lib, inventory,etc etc)
Thats what i mean, his Design looks amazing too. But i don think that he Upgrade OX Inventory much because of this. And this makes me so angry because the Idea behind this Script is so simple and amazing.
Make it for esx_inventory too!
Please make it to where you need a certain amount of items to ccomine something. Like you need 3 buds in a stack and a baggy to make 1G or something
1 Like
it seem like it is not working with ox
it seem like it is not working with ox
i have an issue where the items are swapping instead of combining. Can you tell me how to stop this?
1 Like
DasiRP
July 23, 2023, 8:33pm
21
the same thing happens to me, the objects are interchanged instead of being combined