Twisted-Development
GuidesCoreResourcesDiscord
  • 👋Introduction
  • 📀Rent a FiveM Server
  • Guides
    • 🪟Windows Installation
    • 🔓Setting Permissions
    • 🚀Script Optimization
    • 📑Miscellaneous Guides
    • 📝Visual Studio Code
    • 🔗Useful Links
  • Core
    • 📜Shared
    • ↗️Shared Exports
    • 💬DrawText
    • 📊Player Data
    • 🎮Client Event Reference
    • 🎮Client Function Reference
    • 🖥️Server Event Reference
    • 🖥️Server Function Reference
    • ❗Commands
  • Resources
    • 🔧qb-adminmenu
    • 🚑qb-ambulancejob
    • 🏨qb-apartments
    • 🏦qb-banking
    • 💰qb-bankrobbery
    • 🚌qb-busjob
    • 🏢qb-cityhall
    • 👕qb-clothing
    • 🔄qb-commandbinding
    • 🪙qb-crypto
    • 🤿qb-diving
    • 🚪qb-doorlock
    • 💊qb-drugs
    • 🕺qb-emotes
    • ⌚qb-fitbit
    • ⛽qb-fuel
    • 🚘qb-garages
    • 🚛qb-garbagejob
    • 🌭qb-hotdogjob
    • 🔫qb-houserobbery
    • 🏡qb-houses
    • ℹ️qb-hud
    • 📝qb-input
    • 🏠qb-interior
    • 🎒qb-inventory
    • 💎qb-jewelry
    • ⌨️qb-keyminigame
    • 🏁qb-lapraces
    • 🔃qb-loading
    • 🪛qb-lockpick
    • 👔qb-management
    • ↖️qb-menu
    • 🙋qb-multicharacter
    • 📰qb-newsjob
    • 🤑qb-pawnshop
    • 📱qb-phone
    • 👮qb-policejob
    • 🖨️qb-printer
    • 🔐qb-prison
    • 🔄qb-radialmenu
    • 📻qb-radio
    • ♻️qb-recyclejob
    • 📋qb-scoreboard
    • 🔋qb-scrapyard
    • 🏪qb-shops
    • 🙇qb-skillbar
    • 📚qb-smallresources
    • 🗺️qb-spawn
    • 🔫qb-storerobbery
    • 🏎️qb-streetraces
    • 🚕qb-taxijob
    • 🛻qb-towjob
    • 👁️qb-target
    • 🚛qb-truckerjob
    • 🔫qb-truckrobbery
    • 💻qb-tunerchip
    • 🔨qb-vehiclefailure
    • 🔑qb-vehiclekeys
    • 📄qb-vehiclesales
    • 🚗qb-vehicleshop
    • 🍇qb-vineyard
    • 🔫qb-weapons
    • 🌤️qb-weathersync
    • 🌿qb-weed
Powered by GitBook
On this page
  • Introduction
  • Configuration
  • General
  • Durability multiplier
  • Weapon repair
  • Weapon Attachemnts
  1. Resources

qb-weapons

Pew pew

Introduction

  • Handles the logic for weapon events

  • Change weapon damage

  • Reloading logic

  • Weapon durability

  • Weapon attachments

Configuration

General

Config.ReloadTime = math.random(4000, 6000) -- time it takes to reload

Config.DurabilityBlockedWeapons = { -- these will never break
    "weapon_stungun",
    "weapon_nightstick",
    "weapon_flashlight",
    "weapon_unarmed",
}

Durability multiplier

Config.DurabilityMultiplier = { -- degrade multiplier, higher = quicker degrade
	-- Melee
	-- ['weapon_unarmed'] 				 = 0.15, 
	['weapon_dagger'] 				 = 0.15,
	['weapon_bat'] 				 	 = 0.15,
	['weapon_bottle'] 				 = 0.15,
}

Weapon repair

Config.WeaponRepairPoints = {
    [1] = {
        coords = vector3(964.02, -1267.41, 34.97), -- interaction location
        IsRepairing = false, -- dynamically changes, don't edit
        RepairingData = {}, -- dynamically changes, don't edit
    }
}

Config.WeaponRepairCosts = { -- the price it costs to repair a weapon
    ["pistol"] = 1000,
    ["smg"] = 3000,
    ["mg"] = 4000,
    ["rifle"] = 5000,
    ["sniper"] = 7000,
}

Weapon Attachemnts

WeaponAttachments = {
    -- PISTOLS
    ['WEAPON_PISTOL'] = { --items this weapon accepts as a attachment
        ['defaultclip'] = {
            component = 'COMPONENT_PISTOL_CLIP_01', -- Attachment hash
            item = 'pistol_defaultclip', --Item in the items.lua
            type = 'clip', --type of attachment
        },
        ['extendedclip'] = {
            component = 'COMPONENT_PISTOL_CLIP_02',
            item = 'pistol_extendedclip',
            type = 'clip',
        },
        ['flashlight'] = {
            component = 'COMPONENT_AT_PI_FLSH',
            item = 'pistol_flashlight',
        },
        ['suppressor'] = {
            component = 'COMPONENT_AT_PI_SUPP_02',
            item = 'pistol_suppressor',
        },
        ['luxuryfinish'] = {
            component = 'COMPONENT_PISTOL_VARMOD_LUXE',
            item = 'pistol_luxuryfinish',
        },
    },
}
Previousqb-vineyardNextqb-weathersync

Last updated 2 years ago

🔫