0Gravity - Weapon Lock | Free

๐ Overview
Name: 0Gravity Weapon Lock
Version: 1.0
Framework: Standalone
Library dependency: ox_lib
Author: 0Gravity BVVS
Description:
A lightweight system that allows players to lock and unlock their firearm with a single key (default L
). Locked weapons are disabled from firing until manually unlocked.
๐ Features
โ Toggle weapon lock with a key โ Blocks only specific firearms โ ox_lib notifications and progressbar โ Spam protection for alerts โ Configurable lock/unlock time โ Lightweight & standalone
๐ง How It Works
Press
L
to lock or unlock your weapon.When locked, firing controls (
LMB
,RMB
) are disabled.Unlocking triggers a progress bar before re-enabling weapon use.
If the player tries to shoot while locked, they receive a notification (with cooldown).
โ๏ธ Configuration
Located in config.lua
:
Config.ToggleKey = 182 -- Default: L
Config.UnlockTime = 3000 -- in milliseconds
Config.NotifyCooldown = 2000 -- time between notifications (ms)
Config.FireWeapons = {
"WEAPON_PISTOL",
"WEAPON_COMBATPISTOL",
"WEAPON_APPISTOL",
"WEAPON_SMG",
"WEAPON_ASSAULTRIFLE",
"WEAPON_CARBINERIFLE",
"WEAPON_SNIPERRIFLE"
}
You can customize which weapons are considered "firearms" and adjust timings easily.
๐ ๏ธ Installation
Make sure you have
ox_lib
installed and started before this script.Copy the folder
0gravity_gunblock
into yourresources/
directory.Add the following to your
server.cfg
:ensure ox_lib ensure 0gravity_gunblock
๐ฎ Controls
L
Toggle weapon lock/unlock
๐ File Structure
0gravity_gunblock/
โโโ config.lua # Configurable settings
โโโ client.lua # Main script logic (locking/unlocking)
โโโ fxmanifest.lua # Resource metadata
โโโ README.md # Local readme in Polish
โ Limitations (FREE VERSION)
โ No support for ESX or QBCore out of the box
โ No Discord webhook integration
โ No language localization (hardcoded Polish text)
โ No admin bypass or commands
๐ฆ Dependencies
Make sure it's properly installed and initialized with @ox_lib/init.lua
.
๐งช Example Flow
Player equips a weapon like a pistol.
Player presses
L
โ Weapon is locked.Player tries to shoot โ Notification appears: "Broล zablokowana"
Player presses
L
again โ Progress bar appears for 3 seconds.Weapon is now unlocked and usable again.
๐ฉ Support
Join the support Discord: https://discord.gg/YbuNXpwkWY
Let me know if you'd like this exported to a .md
file, or if you want a PRO version roadmap page added as well.
Last updated