Scriptingbeginner7 min readupdated 11 Sept 2026

Giving weapons proper display names

The short answer

weapons.meta names the weapon with <HumanNameHash> — a text key such as WT_PISTOL. For add-ons, choose a new key (for example WT_MYPISTOL) and register its text on the client with AddTextEntry('WT_MYPISTOL', 'My Pistol'). Components work the same with <LocName>. Read any label with GetLabelText. Inventories like ox_inventory show their own label, so set both.

An add-on weapon that shows “NULL” or an empty name in the weapon wheel is missing one small piece: a text label. GTA stores display names as text keys, and FiveM lets you register new keys from a script with a single native.

Giving weapons proper display names — illustrated with a FiveM-compatible minimap render

#The label in weapons.meta

weapons.meta — excerpt
<Name>WEAPON_MYPISTOL</Name>
<Model>w_pi_mypistol</Model>
<HumanNameHash>WT_MYPISTOL</HumanNameHash>

#Registering the text

client.lua
CreateThread(function()
    AddTextEntry('WT_MYPISTOL', 'Glock 17')
    AddTextEntry('WCT_MYPISTOL_CLIP1', 'Standard Magazine')
    AddTextEntry('WCT_MYPISTOL_CLIP2', 'Extended Magazine')
end)

Run it in any client script of the weapon resource. The weapon wheel and other game UI now show the name. GetLabelText('WT_MYPISTOL') returns Glock 17; unknown keys return NULL.

#Component names

weaponcomponents.meta — excerpt
<Name>COMPONENT_MYPISTOL_CLIP_02</Name>
<LocName>WCT_MYPISTOL_CLIP2</LocName>
<LocDesc>WCD_MYPISTOL_CLIP2</LocDesc>

#Inventory labels

ox_inventory, qb-inventory and ESX show their own labels from their item/weapon definitions — the game label does not change them. Set the same name in both places so the inventory and the weapon wheel agree. See ox_inventory items and ox_inventory weapon setup.

Share this guideXRedditFacebook

Questions

Why does my add-on weapon show NULL?
Its HumanNameHash key has no text. Register it with AddTextEntry on the client.
Where do I put AddTextEntry?
In a client script, for example in the weapon resource itself.
How do I get a weapon’s display name in Lua?
GetLabelText('WT_PISTOL') for the key from HumanNameHash.
Does AddTextEntry change the inventory name?
No. Inventories use their own label fields.

Ready to pick a map?

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

Relevant to what you just read

The tool for this

Fifty-one wheel designs that replace the native HUD wheel From $15, built in the browser, exported as a drop-in resource.