uyuyorumstore

um-tricks

Installation guide for um-tricks

Animated trick knives (butterfly, karambit) and usable hand toys (Zippo, coin, cards, yo-yo, snow globe, hand bell, candy cane) with Halloween and Christmas skins, synced to nearby players.

Install

Icons

Copy everything in um-tricks/setup/images into ox_inventory/web/images.

Weapons

Add inside Weapons = { ... }:

ox_inventory > data > weapons.lua
['WEAPON_BUTTERFLY'] = {
    label = 'Butterfly Knife',
    weight = 300,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},
['WEAPON_KARAMBIT'] = {
    label = 'Karambit',
    weight = 250,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},
['WEAPON_BUTTERFLY_HW'] = {
    label = 'Bone Butterfly',
    weight = 300,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},
['WEAPON_KARAMBIT_HW'] = {
    label = 'Bone Karambit',
    weight = 250,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},
['WEAPON_BUTTERFLY_XM'] = {
    label = 'Candy Cane Butterfly',
    weight = 300,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},
['WEAPON_KARAMBIT_XM'] = {
    label = 'Holly Karambit',
    weight = 250,
    durability = 0.1,
    anim = { 'anim@melee@switchblade@holster', 'unholster', 200, 'anim@melee@switchblade@holster', 'holster', 600 },
},

Items

ox_inventory > data > items.lua
['zippo'] = {
    label = 'Zippo',
    weight = 60,
    close = true,
    description = 'Brushed chrome, the lid clicks open',
},
['coin'] = {
    label = 'Coin',
    weight = 10,
    close = true,
    description = 'A lucky brass coin',
},
['cards'] = {
    label = 'Playing Cards',
    weight = 90,
    close = true,
    description = 'A worn deck, red backs',
},
['yoyo'] = {
    label = 'Yo-yo',
    weight = 60,
    close = true,
    description = 'Red, with a long cotton string',
},
['zippo_hw'] = {
    label = 'Ghost Zippo',
    weight = 60,
    close = true,
    description = 'Blackened, a skull that glows, burns green',
},
['coin_hw'] = {
    label = 'Skull Coin',
    weight = 10,
    close = true,
    description = 'Its eyes glow red in the dark',
},
['cards_hw'] = {
    label = 'Haunted Cards',
    weight = 90,
    close = true,
    description = 'Spider web backs, a skull glowing on each',
},
['yoyo_hw'] = {
    label = "Jack-o'-Yo-yo",
    weight = 60,
    close = true,
    description = 'A carved pumpkin that lights up as it spins',
},
['zippo_xm'] = {
    label = 'Sweater Zippo',
    weight = 60,
    close = true,
    description = 'Christmas sweater knit, a lit tree, a red flame',
},
['coin_xm'] = {
    label = 'Snowflake Coin',
    weight = 10,
    close = true,
    description = 'Green and red, a snowflake that glows',
},
['cards_xm'] = {
    label = 'Christmas Cards',
    weight = 90,
    close = true,
    description = 'Red backs, a Christmas tree that lights up',
},
['yoyo_xm'] = {
    label = 'Santa Yo-yo',
    weight = 60,
    close = true,
    description = 'Santa red, white fur, a ring of lights, a little hat',
},
['snowglobe'] = {
    label = 'Snow Globe',
    weight = 250,
    close = true,
    description = 'A lit Christmas tree under glass. Shake it',
},
['handbell'] = {
    label = 'Hand Bell',
    weight = 200,
    close = true,
    description = 'Candy cane handle, a red bow, a ring of lights',
},
['candycane'] = {
    label = 'Candy Cane',
    weight = 30,
    close = true,
    description = 'Peppermint stripes that glow, for twirling',
},

Icons

Copy everything in um-tricks/setup/images into qb-inventory/html/images.

Weapons

qb-core > shared > weapons.lua
[`weapon_butterfly`]    = { name = 'weapon_butterfly',    label = 'Butterfly Knife', weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
[`weapon_karambit`]     = { name = 'weapon_karambit',     label = 'Karambit',        weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
[`weapon_butterfly_hw`] = { name = 'weapon_butterfly_hw', label = 'Bone Butterfly',  weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
[`weapon_karambit_hw`]  = { name = 'weapon_karambit_hw',  label = 'Bone Karambit',   weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
[`weapon_butterfly_xm`] = { name = 'weapon_butterfly_xm', label = 'Candy Cane Butterfly', weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
[`weapon_karambit_xm`]  = { name = 'weapon_karambit_xm',  label = 'Holly Karambit',  weapontype = 'Melee', ammotype = nil, damagereason = 'Knifed / Stabbed / Eviscerated' },
qb-core > shared > items.lua
weapon_butterfly    = { name = 'weapon_butterfly',    label = 'Butterfly Knife', weight = 300, type = 'weapon', ammotype = nil, image = 'WEAPON_BUTTERFLY.png',    unique = true, useable = false, description = 'A balisong, flips open in the hand' },
weapon_karambit     = { name = 'weapon_karambit',     label = 'Karambit',        weight = 250, type = 'weapon', ammotype = nil, image = 'WEAPON_KARAMBIT.png',     unique = true, useable = false, description = 'A curved blade with a finger ring' },
weapon_butterfly_hw = { name = 'weapon_butterfly_hw', label = 'Bone Butterfly',  weight = 300, type = 'weapon', ammotype = nil, image = 'WEAPON_BUTTERFLY_HW.png', unique = true, useable = false, description = 'Glowing runes, bone handles' },
weapon_karambit_hw  = { name = 'weapon_karambit_hw',  label = 'Bone Karambit',   weight = 250, type = 'weapon', ammotype = nil, image = 'WEAPON_KARAMBIT_HW.png',  unique = true, useable = false, description = 'A glowing edge, a bone handle' },
weapon_butterfly_xm = { name = 'weapon_butterfly_xm', label = 'Candy Cane Butterfly', weight = 300, type = 'weapon', ammotype = nil, image = 'WEAPON_BUTTERFLY_XM.png', unique = true, useable = false, description = 'Candy cane handles, a string of Christmas lights' },
weapon_karambit_xm  = { name = 'weapon_karambit_xm',  label = 'Holly Karambit',  weight = 250, type = 'weapon', ammotype = nil, image = 'WEAPON_KARAMBIT_XM.png',  unique = true, useable = false, description = 'Pine green, a glowing red edge, snowflakes' },

Items

qb-core > shared > items.lua
zippo    = { name = 'zippo',    label = 'Zippo',          weight = 60, type = 'item', image = 'zippo.png',    unique = false, useable = true, shouldClose = true, description = 'Brushed chrome, the lid clicks open' },
coin     = { name = 'coin',     label = 'Coin',           weight = 10, type = 'item', image = 'coin.png',     unique = false, useable = true, shouldClose = true, description = 'A lucky brass coin' },
cards    = { name = 'cards',    label = 'Playing Cards',  weight = 90, type = 'item', image = 'cards.png',    unique = false, useable = true, shouldClose = true, description = 'A worn deck, red backs' },
yoyo     = { name = 'yoyo',     label = 'Yo-yo',          weight = 60, type = 'item', image = 'yoyo.png',     unique = false, useable = true, shouldClose = true, description = 'Red, with a long cotton string' },
zippo_hw = { name = 'zippo_hw', label = 'Ghost Zippo',    weight = 60, type = 'item', image = 'zippo_hw.png', unique = false, useable = true, shouldClose = true, description = 'Blackened, a skull that glows, burns green' },
coin_hw  = { name = 'coin_hw',  label = 'Skull Coin',     weight = 10, type = 'item', image = 'coin_hw.png',  unique = false, useable = true, shouldClose = true, description = 'Its eyes glow red in the dark' },
cards_hw = { name = 'cards_hw', label = 'Haunted Cards',  weight = 90, type = 'item', image = 'cards_hw.png', unique = false, useable = true, shouldClose = true, description = 'Spider web backs, a skull glowing on each' },
yoyo_hw  = { name = 'yoyo_hw',  label = "Jack-o'-Yo-yo",  weight = 60, type = 'item', image = 'yoyo_hw.png',  unique = false, useable = true, shouldClose = true, description = 'A carved pumpkin that lights up as it spins' },
zippo_xm  = { name = 'zippo_xm',  label = 'Sweater Zippo',   weight = 60,  type = 'item', image = 'zippo_xm.png',  unique = false, useable = true, shouldClose = true, description = 'Christmas sweater knit, a lit tree, a red flame' },
coin_xm   = { name = 'coin_xm',   label = 'Snowflake Coin', weight = 10,  type = 'item', image = 'coin_xm.png',   unique = false, useable = true, shouldClose = true, description = 'Green and red, a snowflake that glows' },
cards_xm  = { name = 'cards_xm',  label = 'Christmas Cards',  weight = 90,  type = 'item', image = 'cards_xm.png',  unique = false, useable = true, shouldClose = true, description = 'Red backs, a Christmas tree that lights up' },
yoyo_xm   = { name = 'yoyo_xm',   label = 'Santa Yo-yo',   weight = 60,  type = 'item', image = 'yoyo_xm.png',   unique = false, useable = true, shouldClose = true, description = 'Santa red, white fur, a ring of lights, a little hat' },
snowglobe = { name = 'snowglobe', label = 'Snow Globe',     weight = 250, type = 'item', image = 'snowglobe.png', unique = false, useable = true, shouldClose = true, description = 'A lit Christmas tree under glass. Shake it' },
handbell  = { name = 'handbell',  label = 'Hand Bell',      weight = 200, type = 'item', image = 'handbell.png',  unique = false, useable = true, shouldClose = true, description = 'Candy cane handle, a red bow, a ring of lights' },
candycane = { name = 'candycane', label = 'Candy Cane',     weight = 30,  type = 'item', image = 'candycane.png', unique = false, useable = true, shouldClose = true, description = 'Peppermint stripes that glow, for twirling' },

Server.cfg

Start um-tricks after your framework and inventory:

server.cfg
ensure ox_lib
ensure qbx_core # or qb-core / es_extended
ensure ox_inventory # or qb-inventory
ensure um-tricks

Usage

  • Knives: the draw plays when taken out, G plays the tricks. Players can rebind it in Settings > Key Bindings > FiveM
  • Toys: every use plays the next trick

Test with /giveitem [id] yoyo 1 or /giveitem [id] weapon_karambit 1.

Seasonal packs

The _hw (Halloween) and _xm (Christmas) items, snowglobe, handbell and candycane are ordinary entries in shared/config.lua under their pack's comment. Both packs work side by side. To take a pack out of rotation, delete or comment out its entries there and its items in your inventory.

Requirements

  • ox_lib
  • A framework: qbx_core, qb-core or es_extended

On this page