[PAID] Ox_inventory Custom Item Drops

Summary
This is a simple and accessible script with which you can create props every time you throw an itemon the ground.

Previews

Youtube Video


Config

Config.Models = {
    ['burger'] = 'prop_cs_burger_01', -- Example. Add your own items with the next format: ['item'] = 'prop'
}

Get it

Requirements

Features

  • Easily configurable.

  • 0.0 resmon.

  • Add all your own items and props!

1 Like

Is it Throwable?

1 Like

Of course!

Woah! Cool! how does this work?

Hi! When you drop an item, a prop will be created at your location. The preview will be available soon.

soo… this? :face_with_raised_eyebrow:

1 Like

No, the script configures models for the different items and causes drops to be created with the configured models. You can watch the video if you have questions

Here it is for free in just ~5 minutes.

local dropItems = {
    burger = `prop_cs_burger_01`
}

exports.ox_inventory:registerHook('swapItems', function(payload)
    if payload.toInventory ~= 'newdrop' or not dropItems[item.name] then return end

    local item = payload.fromSlot
    local items = { { item.name, payload.count, item.metadata } }
    local dropId = exports.ox_inventory:CustomDrop(item.label, items,
        GetEntityCoords(GetPlayerPed(payload.source)), 1, item.weight, nil, dropItems[item.name])

    if not dropId then return end

    CreateThread(function()
        exports.ox_inventory:RemoveItem(payload.source, item.name, payload.count, nil, item.slot)
        Wait(0)
        exports.ox_inventory:forceOpenInventory(payload.source, 'drop', dropId)
    end)

    return false
end, {
    itemFilter = dropItems,
    typeFilter = { player = true }
})
17 Likes

Hello, could you explain the installation to us?

giga chad bro XD

If a slap in the face was a real person. You’re a legend, Linden :joy: :heartbeat:

With your super function, if you drop two items in a single drop, the prop of the first item remains, no other one would be created.

The installation is in the readme.md.

I had to modify part of your script to be able to make ours. When you purchase our script it comes with instructions in which we explain step by step what to do and what to replace in your ox_inventory.

local dropItems = {
    burger = `prop_cs_burger_01`
}

exports.ox_inventory:registerHook('swapItems', function(payload)
    if payload.toInventory ~= 'newdrop' then return end

    local items = {}
    for _, item in pairs(payload.items) do
        table.insert(items, { item.name, item.count })
    end

    local dropCoords = GetEntityCoords(GetPlayerPed(payload.source))
    local dropId = exports.ox_inventory:CustomDrop("Custom Drop", items, dropCoords, 1, 0, nil, nil)

    if not dropId then return end

    CreateThread(function()
        for _, item in pairs(payload.items) do
            exports.ox_inventory:RemoveItem(payload.source, item.name, item.count, nil, item.slot)
            Wait(0)
        end
        exports.ox_inventory:forceOpenInventory(payload.source, 'drop', dropId)
    end)

    return false
end, {
    itemFilter = dropItems,
    typeFilter = { player = true }
})

so you’re basically reselling modifed version of ox_inventory

Where would I put this in my server.lua? when I put it in it breaks it

A script that works with a part that you have to replace in your ox_inventory, and I give you the instructions.

It doesn’t work for you because that’s not how it’s done.

and im not paying you $5 for an addon to a free inventory :smiley: