π―Β Cosmic Weapon License & Shooting Range System β v2.0
A polished, multi-framework weapon licensing system for FiveM β full framework auto-detection, private per-player shooting range, deep anti-cheat, and Discord logging out of the box.
Give your RP server a realistic firearm-licensing progression: an in-game NPC, a written safety exam, and a live shooting-range test β all in one clean, themable UI.
β¨ Core Features
π§Ύ Advanced License System
- Theory Test β multi-choice firearm-safety quiz (fully editable question pool, random order every attempt)
- Practical Test β live shooting range, shot-based, dynamic target spawns
- Practice Mode β train freely at the range without affecting your license record
- Four Difficulties β Easy, Medium, Hard, Impossible (all values tunable)
- Two-Stage Licensing β Weapon Theory Pass (
wtp) unlocks the practical test; passing the practical grants the full Weapon License (weapon) - Optional License Card Item β hand players a physical inventory item on grant (toggle on/off)
π§ True Multi-Framework Auto-Detect
Set once, works everywhere. Config.Framework = 'auto' detects the running framework at startup:
- ESX Legacy
- QBCore
- QBox
- Standalone (own SQL table, in-memory money)
Or force any specific framework in the config if you run multiple side-by-side.
π― Target & Interaction β Also Auto-Detect
Config.UseTarget = trueβ auto-detects ox_target or qb-target at runtime and attaches to the NPCConfig.UseTarget = falseβ falls back to a floating 3D text prompt (press E)
No separate "target resource" config to maintain β just one boolean.
π Full Localization β 7 Languages
Ships translated in:
- English (en)
- German (de)
- French (fr)
- Spanish (es)
- Portuguese (pt)
- Dutch (nl)
- Turkish (tr)
- Missing keys fall back to English β add your own language by dropping a new locale file
π Smart Weapon Handling & Anti-Cheat
The script issues real weapons for the test and tracks every one. The range weapon is auto-removed when:
- The test ends (pass or fail)
- The player walks out of the range zone
- The player disconnects mid-test
- The player rejoins with a leftover weapon from a prior session
- The resource or the server restarts
Active cheat detection during tests β instant test cancellation on:
- Dropping the weapon (drop-key)
- Switching to a different weapon
- Trying to drag/give/drop the range weapon through inventory (blocked at the ox_inventory
swapItemshook level)
πΉ Shooting Range Mechanics
Shot-based, skill-driven test:
- Every shot counts β hit or miss, the next target spawns
- Timed target exposure β misses time out and move on
- Private routing bucket per player β no interference, no shared targets
- Full weapon control: no reloads, no ammo depletion, no ammo leak to personal weapons
Default difficulty presets (fully editable):
- Easy β 20 targets, 1500ms exposure, 15 hits to pass
- Medium β 20 targets, 1000ms exposure, 16 hits to pass
- Hard β 20 targets, 800ms exposure, 17 hits to pass
- Impossible β 20 targets, 500ms exposure, 19 hits to pass
π Weapon Delivery β Your Inventory, Your Way
- ox_inventory mode β weapon added as inventory item with tracked metadata; player equips manually
- Native mode β weapon placed directly on the ped (qb-inventory, qs-inventory, tgiann, any inventory that doesn't strip weapons)
π’ Discord Logging
Separate webhook channels for every category, or one general fallback:
- License grants
- Test results (pass/fail)
- Practice sessions
- Cheat detection & weapon tampering
generalfallback catches anything with an empty category URL
π¨ Modern, Themable UI
- Clean React NUI, GPU-accelerated animations, smooth notifications
- Built-in color presets: red, purple, green, orange, blue
- Full custom hex support to match your server brand
- Text selection disabled globally β no accidental blue highlights
βοΈ Configuration Overview
Framework Setup (auto by default):
Config.Framework = 'auto' -- 'auto' | 'esx' | 'qbcore' | 'qbox' | 'standalone'
Interaction:
Config.UseTarget = true -- auto-detects ox_target / qb-target, or falls back to 3D text
Weapon System:
Config.WeaponSystem = 'ox_inventory' -- 'ox_inventory' | 'native'
Language:
Config.Locale = 'en' -- 'en' | 'de' | 'fr' | 'es' | 'pt' | 'nl' | 'tr'
Fees & Requirements:
Config.ModeSettings.Practice.Fee = 5000Config.ModeSettings.TheoryTest.Fee = 8000Config.ModeSettings.PracticalTest.Fee = 15200
π§© Dependencies
- FiveM Build 5848+
- OneSync enabled
- oxmysql
- One of: es_extended / qb-core / qbx_core β or nothing (standalone)
- ox_inventory β only if
Config.WeaponSystem = 'ox_inventory' - ox_target or qb-target β only if
Config.UseTarget = true(auto-detected) - No ox_lib dependency β QBox works without it
π¦ Installation
- Extract into
resources/ascosmic_weaponlicense - Add
ensure cosmic_weaponlicensetoserver.cfg - Open
shared/config.luaβ tune fees, difficulty, NPC location, theme, Discord webhooks - Restart the server β the console will confirm the detected framework
π§ Customization
- All fees, difficulty, target counts and timings in
shared/config.lua - Add unlimited NPC locations β every NPC carries its own model, scenario, weapon, freeze/invincible/blockevents, and blip settings
- Edit the shooting range positions and target spawn pool
- Drop in your own language file β just add it to
locales/and to the fxmanifest - Full theme customization via hex
π½οΈ Preview
https://www.youtube.com/watch?v=pIrVf2KFVu0
π‘οΈ License & Terms
- Copyright Β© Cosmic Crafts. All rights reserved.
- Redistribution, resale, rebranding, or repackaging is prohibited without written permission.
- Do not reverse-engineer, unpack the escrow, or claim ownership of this resource.
- For permissions or licensing issues: Cosmic Crafts Discord
π€ Support
- Discord: https://discord.gg/HFq2pBeZAk
- Tebex: https://cosmic-crafts.tebex.io
Made with β€οΈ by Cosmic Crafts

