WeaponTints

MrNewbWeaponTints

ox_inventory tint items plus a heavy file that strips weapon serials. Built on Newb_Bridge.

This is the exception to the usual MrNewb item rule: these items do use ox_inventory server.export. ox_inventory only — there is no QB tab.

GitHub · Discord · Installation · Item setup · Exports

Features

  • Seven vanilla weapon tints as usable items (greentintplatinumtint)
  • newbserialfile writes a filed-off serial onto the equipped weapon
  • MK2 weapons remap server.tint through a built-in index table
  • ox_inventory metadata (tint, weapontint, serial) — no SQL, no config file
  • Strings in locales/*.json (ox_lib)

Requirements

  • Newb_Bridge
  • ox_lib
  • ox_inventory (hard dependency in fxmanifest.lua)
  • Artifact /server:6116 or newer, OneSync

No config file. Item names, server.tint, and server.export live in ox_inventory/data/items.lua. Start after ox_lib, ox_inventory, and Newb_Bridge. Keep the folder named MrNewbWeaponTints — the server.export strings include that name. No commands.

Items

ItemLabelExportExtra
greentintGreen Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 1
goldtintGold Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 2
pinktintPink Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 3
armytintArmy Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 4
lspdtintLSPD Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 5
orangetintOrange Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 6
platinumtintPlatinum Weapon TintMrNewbWeaponTints.setweapontintserver.tint = 7
newbserialfileHeavy FileMrNewbWeaponTints.newbserialfileconsume = 0.50
greentint goldtint pinktint armytint lspdtint orangetint platinumtint newbserialfile

The equipped weapon is required (ox_inventory:GetCurrentWeapon). usingItem returns false with no weapon in hand (item is not consumed) and true when a weapon is equipped. usedItem writes metadata, notifies, and disarms so the next draw shows the new tint or serial.

allowArmed = true is required on every item. Without it, ox_inventory blocks use while a weapon is out. Tint items omit consume. newbserialfile sets consume = 0.50 (two uses).

Green is a dark military green, not neon. Custom weapon streams that replace tint palettes can hide or clash with these indices.

Tint items set metadata.tint and metadata.weapontint (the item label) on the weapon slot. The serial file sets metadata.serial to the locale string WeaponTints.SerialRemoved (The serial number has been filed off in locales/en.json). ox_inventory applies metadata.tint when the weapon is drawn. weapontint is display-only.

MK2 weapons remap the vanilla tint id through a built-in table in resource/server/weapon_items.lua. A weapon is treated as MK2 when its item name contains MK2 (case-insensitive):

server.tintMK2 index
00
118
223
313
48
522
615
724

Unknown ids pass through unchanged. There is no tint 0 item. Custom MK2 weapons must include MK2 in the item name or they get vanilla tint ids.

Adding a tint

Duplicate a shipped tint in ox_inventory/data/items.lua, change the name, label, and server.tint (17). Keep server.export = 'MrNewbWeaponTints.setweapontint'. Copy a PNG whose filename matches the item name. Extra items only pick a different built-in GTA index — you cannot add a visual the game does not already ship.

Locales

locales/*.json, loaded with lib.locale(). ox_lib picks the client language. Edit locales/en.json (or add a file) and restart.

KeyWhen
WeaponTints.NotEquippedUse with no current weapon
WeaponTints.HasBeenAppliedTint applied (item.label, weapon.label)
WeaponTints.SerialRemovedWritten into metadata.serial
WeaponTints.SerialRemovedSuccessSerial file succeeded (weapon.label)

Layout

PathRole
fxmanifest.luaDepends on ox_lib, ox_inventory, Newb_Bridge
resource/server/weapon_items.luasetweapontint and newbserialfile exports
locales/*.jsonEquipped / applied / serial strings
[INSTALL]/images/Item PNGs (armytint, goldtint, greentint, lspdtint, orangetint, pinktint, platinumtint, newbserialfile)

On start the resource runs Newb_Bridge VersionCheck (MrNewb/patchnotes).

Exports

Exact ox_inventory server.export strings (resource name + export):

Exportserver.export valuePurpose
setweapontint'MrNewbWeaponTints.setweapontint'ox_inventory usingItem / usedItem tint handler
newbserialfile'MrNewbWeaponTints.newbserialfile'Same hook; writes serial metadata

These are ox_inventory hooks, not helpers for other resources. Do not call them from your own scripts. Signatures: Server exports.

Paste: Item setup.