Installation
1. Download Resource
Download the purchased resource from CFX Portal - the official site of FiveM with purchased resources.
2. Import Database Tables
This is a very important step - without it, the script will not work properly. Depending on the framework you are using (ESX, QBCORE or QBOX), select the appropriate section below and paste the SQL code into your database.
SQL for Database
-- Run this SQL file in your database before starting the resource
CREATE TABLE IF NOT EXISTS `weapon_bodycount` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(50) NOT NULL,
`serial` varchar(50) NOT NULL,
`bodycount` int(11) DEFAULT 0,
`scratched` tinyint(1) DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `serial` (`serial`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;3. Add Required Items
Add the items to your inventory system’s item file or database, then copy the images from orbit-bodycount/install/images into your inventory’s image folder.
ESX Installation
-- ============================================
-- ESX ORBIT BODYCOUNT COMPLETE INSTALLATION
-- ============================================
-- This file contains everything needed for ESX
--
-- STEP 1: Run database.sql in your database first!
-- STEP 2: Add the dremel item
-- STEP 3: Add the image file
-- ============================================
-- [[[ STEP 1: DATABASE SETUP ]]]
-- IMPORTANT: Run install/database.sql in your database FIRST!
-- This creates the weapon_bodycount table
-- [[[ STEP 2: ADD DREMEL ITEM ]]]
-- Run this SQL in your database (phpMyAdmin, HeidiSQL, etc.):
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`)
VALUES ('dremel', 'Dremel Tool', 500, 0, 1);
-- OR if you're using es_extended items configuration instead of database:
-- Add this to your items file:
--[[
['dremel'] = {
label = 'Dremel Tool',
weight = 500,
stack = true,
close = true,
description = 'A tool for scratching serial numbers off weapons'
},
]]
-- [[[ STEP 3: ADD DREMEL IMAGE ]]]
-- You need a PNG image file for the dremel
-- Place it in your inventory images folder:
--
-- For esx_inventoryhud: esx_inventoryhud/html/img/items/dremel.png
-- For ox_inventory: ox_inventory/web/images/dremel.png
--
-- (Place your dremel.png in install/images/ folder)
-- [[[ STEP 4: CONFIGURATION ]]]
-- Edit config.lua:
-- Config.Framework = "ESX" (or "auto" for auto-detection)
-- Config.Inventory = "esx_inventoryhud" (or "ox_inventory")
-- Config.Notification = "esx" (or "ox_lib")
-- Config.Progressbar = "esx" (or "ox_lib")
-- [[[ STEP 5: RESTART ]]]
-- Restart your server
print("========================================")
print("ESX Orbit Bodycount Installation Complete")
print("========================================")
print("1. Run install/database.sql in your database")
print("2. Run the SQL above to add dremel item")
print("3. Add dremel.png to your inventory images")
print("4. Configure config.lua")
print("5. Restart your server")
print("========================================")OX Inventory Installation
-- ============================================
-- OX INVENTORY ORBIT BODYCOUNT COMPLETE INSTALLATION
-- ============================================
-- This file contains everything needed for OX Inventory
--
-- STEP 1: Run database.sql in your database first!
-- STEP 2: Add the Lua items to ox_inventory
-- STEP 3: Add the image file
-- STEP 4: OPTIONAL - Enhanced inventory display
-- ============================================
-- [[[ STEP 1: DATABASE SETUP ]]]
-- IMPORTANT: Run install/database.sql in your database FIRST!
-- This creates the weapon_bodycount table
-- [[[ STEP 2: ADD TO OX INVENTORY ]]]
-- Copy and paste this code into: ox_inventory/data/items.lua
-- Add it with the other items, usually at the bottom or in alphabetical order
['dremel'] = {
label = 'Dremel Tool',
weight = 500,
stack = true,
close = true,
description = 'A tool for scratching serial numbers off weapons'
},
-- [[[ STEP 3: ADD DREMEL IMAGE ]]]
-- You need a PNG image file for the dremel
-- Place it in: ox_inventory/web/images/dremel.png
--
-- (Place your dremel.png in install/images/ folder)
-- [[[ STEP 4: OPTIONAL - ENHANCED INVENTORY DISPLAY ]]]
-- If you want weapon eliminations/bodycount to show in your inventory UI:
--
-- 1. BACKUP YOUR ORIGINAL FILE FIRST!
-- Go to: ox_inventory/modules/items/
-- Copy server.lua and save it somewhere safe (server.lua.backup)
--
-- 2. Replace ox_inventory/modules/items/server.lua with the items.lua
-- file provided in this install folder
-- (Rename items.lua to server.lua)
--
-- 3. This adds:
-- - "Eliminations: X" shown in weapon descriptions
-- - Automatic bodycount sync when weapons are loaded
-- - Real-time updates when kills are recorded
-- - Shows "Unknown" for scratched weapons
--
-- NOTE: Script works perfectly WITHOUT this step!
-- You just won't see bodycount in inventory UI
-- (but /bodycount command still works)
-- [[[ STEP 5: CONFIGURATION ]]]
-- Edit config.lua:
-- Config.Framework = "auto" (auto-detects ESX/QBCore/QBox)
-- Config.Inventory = "ox_inventory"
-- Config.Notification = "ox_lib"
-- Config.Progressbar = "ox_lib"
-- [[[ STEP 6: RESTART ]]]
-- Restart ox_inventory and orbit-bodycount
print("========================================")
print("OX Inventory Orbit Bodycount Installation Complete")
print("========================================")
print("1. Run install/database.sql in your database")
print("2. Add Lua code to ox_inventory/data/items.lua")
print("3. Add dremel.png to ox_inventory/web/images/")
print("4. OPTIONAL: Replace items server.lua for UI display")
print("5. Configure config.lua")
print("6. Restart ox_inventory and orbit-bodycount")
print("========================================")4. Configuration
Configure config.lua to match your server framework and preferences, and change the configuration options to your own liking.
5. Start Resource
To start a resource in your server.cfg, ensure that it begins after your framework has been initiated. For instance, if you are using a framework like es_extended, you should start resource after it, like so:
Last updated