Inventorybeginner7 min readupdated 11 Sept 2026

The QBCore weapons table

The short answer

QBCore.Shared.Weapons is keyed by the weapon hash (written with backticks, e.g. [`weapon_pistol`]) and holds name, label, weapontype (Pistol, Rifle, Melee…), ammotype and damagereason text. Scripts use it to turn a hash from a native into a name, type or kill-log text. For an add-on weapon, add an entry here and a matching weapon item in shared/items.lua.

QBCore describes weapons in two places: as items in shared/items.lua (so they fit in the inventory) and as weapons in shared/weapons.lua (so scripts know what a hash is). Add-on weapons need both, and the weapons table is the one people forget.

The QBCore weapons table — illustrated with a FiveM-compatible minimap render

#The format

qb-core/shared/weapons.lua
QBCore.Shared.Weapons = {
    [`weapon_pistol`] = { name = 'weapon_pistol', label = 'Walther P99', weapontype = 'Pistol', ammotype = 'AMMO_PISTOL', damagereason = 'Pistoled / Blasted / Plugged / Bust a cap in' },
    [`weapon_bat`] = { name = 'weapon_bat', label = 'Bat', weapontype = 'Melee', ammotype = nil, damagereason = 'Melee killed / Whacked / Executed / Beat down / Murdered / Battered' },
}

#What uses it

client.lua — name of the weapon in hand
local QBCore = exports['qb-core']:GetCoreObject()
local hash = GetSelectedPedWeapon(PlayerPedId())
local info = QBCore.Shared.Weapons[hash]
if info then print(info.label, info.weapontype) end

Death screens and kill logs turn the killer’s weapon hash into text through this table. A missing entry shows as unknown or breaks those scripts. Hashes explained: weapon hashes.

#Adding an add-on weapon

  1. Add [`weapon_mypistol`] = { name = 'weapon_mypistol', label = 'My Pistol', weapontype = 'Pistol', ammotype = 'AMMO_PISTOL', damagereason = 'Shot' }.
  2. Add the item weapon_mypistol with type = 'weapon' to shared/items.lua — see QBCore shared items.
  3. Add the image and restart the server.

Full walkthrough: QBCore weapon setup.

Share this guideXRedditFacebook

Questions

What is qb-core shared/weapons.lua for?
It maps weapon hashes to names, labels, types, ammo types and death-message text for scripts.
Do I need to edit weapons.lua for an add-on weapon?
Yes, in addition to adding the weapon item to items.lua.
Why are the keys in backticks?
Backticks produce the weapon hash at compile time, so scripts can look weapons up by the hash natives return.
What is damagereason used for?
Text for death and kill messages.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.

Relevant to what you just read