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
Lto 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:
You can customize which weapons are considered "firearms" and adjust timings easily.
🛠️ Installation
Make sure you have
ox_libinstalled and started before this script.Copy the folder
0gravity_gunblockinto yourresources/directory.Add the following to your
server.cfg:
🎮 Controls
L
Toggle weapon lock/unlock
📂 File Structure
❗ 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
Lagain → 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