[FREE] Fosty AmmoBox [ESX,QB/Ox Inventory]

What is it?
This is the script that allows you to use ammo as packages. For example, when you buy an ammo box and open it, you receive 25 rounds, and the script is fully adaptable for all users.
Feel free to ask if you have any more questions!

Features

  • 0.0 ms Usage
  • Customizable item name
  • Compatible with ox_core, ESX, QBCore, whatever else running ox_inventory

Dependencies

  • ox_inventory
  • es_extended

Preview

When you open the ammo box:
image

Download script:
fosty_ammobox.zip (50.0 KB)

Feel free to customize and adapt the description according to your specific server context and preferences.

12 Likes

Thanks for sharing this! helps alot i’ve been searching for this

1 Like

HI, what is the Ox-inventory redesign I really like it

1 Like

Hello, here is the link to the Ox Inventory redesign. I just modified the build file, and now it’s functioning correctly!
Link: GitHub - Javierko/ox_inventory-kktrp: Slot-based inventory with metadata.

1 Like

I appreciate any free release, but there’s literally no point in using this.

ox_inventory > modules > items > server.lua

Item('box_ammo_9', function(event, item, inventory, data, slot)
	if event == 'usedItem' then
    	Inventory.AddItem(inventory, 'ammo-9', 120)
	end
end)

ox_inventory > items.lua

	['box_ammo_9'] = {
        label = 'Ammo Case: 9x9mm (x120)',
        weight = 5,
        --consume = 0,
        description = "A case of stuff to make problems go away",
        client = {
            anim = { dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@', 
            clip = 'machinic_loop_mechandplayer', flag = 3 },
            prop = { model = 'prop_box_ammo02a', -- need badge props repo
            pos = vec3(0.0, 0.7, -0.40), 
            rot = vec3(0.00, 0.00, 90.00), 
            bone = 56604  },
            disable = { move = false, car = false, combat = false },
            usetime = 5000,
        }
    },

(ox lib takes care of progress bar)

This is already built into ox, if you were to look at any ox inventory extras that people offer such as

Then you’d see for yourself… these scripts are just creating bloat.

2 Likes

Hello, thank you for the reply. I created this script so that anyone can use it. I’ve been in the same situation where I couldn’t create my own scripts, so I wanted to help others who might find it difficult, especially beginners. I hope I’ve answered your question.

1 Like

thanks

1 Like

Hello.
I am using ox-inventory with qbcore.
Could you please release one with qb-core support?

1 Like

Hello!
I will soon provide the Fosty AmmoBox V2 with improved animations and additional features.

2 Likes

This is QBcore supported tho? please read the description first.

1 Like

do you have ox inventory

and you have to change esxport from esx to qb

local QBCore = exports[‘qb-core’]:GetCoreObject()

QBCore.Functions.CreateUseableItem(‘ammo-9-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-9-box', 1)
Player.Functions.AddItem('ammo-9', 50)

end)

QBCore.Functions.CreateUseableItem(‘ammo-rifle-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-rifle-box', 1)
Player.Functions.AddItem('ammo-rifle', 50)

end)

QBCore.Functions.CreateUseableItem(‘ammo-rifle2-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-rifle2-box', 1)
Player.Functions.AddItem('ammo-rifle2', 50)

end)

QBCore.Functions.CreateUseableItem(‘ammo-shotgun-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-shotgun-box', 1)
Player.Functions.AddItem('ammo-shotgun', 50)

end)

QBCore.Functions.CreateUseableItem(‘ammo-45-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-45-box', 1)
Player.Functions.AddItem('ammo-45', 50)

end)

QBCore.Functions.CreateUseableItem(‘ammo-45-box’, function(source)
local Player = QBCore.Functions.GetPlayer(source)

Player.Functions.RemoveItem('ammo-sniper-box', 1)
Player.Functions.AddItem('ammo-sniper', 50)

end)

1 Like

Hello, Im trying to get this to work, i have the item in ox_inventory, i have changed the vs file to the export the person is putting above and im still not getting ammo from the box?
qb-core btw

To bad we don’t have the prop rep to be able to do so.

how to use on qb or qbox?

manifest?

Thanks brother

Let me know if you need the MI Utils, still have the latest copy from GitHub OS before he randomly removed it with no word. Required to make some of the snippets function.

So far it worked for me, it wouldn’t be bad to have it in case something goes wrong