0Gravity
DISCORD
  • Introduction
  • FAQ
  • Summary
  • Developer Guide
  • Scripts
    • Fake Plates
    • PIN Code Minigame
  • Teleport Menu
  • 0Gravity - Weapon Lock | Free
Powered by GitBook
On this page
  • ๐Ÿ“˜ Overview
  • ๐Ÿš€ Features
  • ๐Ÿง  How It Works
  • โš™๏ธ Configuration
  • ๐Ÿ› ๏ธ Installation
  • ๐ŸŽฎ Controls
  • ๐Ÿ“‚ File Structure
  • โ— Limitations (FREE VERSION)
  • ๐Ÿ“ฆ Dependencies
  • ๐Ÿงช Example Flow
  • ๐Ÿ“ฉ Support

0Gravity - Weapon Lock | Free

PreviousTeleport Menu

Last updated 1 month ago


๐Ÿ“˜ Overview


๐Ÿš€ 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

  1. Make sure you have ox_lib installed and started before this script.

  2. Copy the folder 0gravity_gunblock into your resources/ directory.

  3. Add the following to your server.cfg:

    ensure ox_lib
    ensure 0gravity_gunblock

๐ŸŽฎ Controls

Key
Action

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

  1. Player equips a weapon like a pistol.

  2. Player presses L โ†’ Weapon is locked.

  3. Player tries to shoot โ†’ Notification appears: "Broล„ zablokowana"

  4. Player presses L again โ†’ Progress bar appears for 3 seconds.

  5. Weapon is now unlocked and usable again.


๐Ÿ“ฉ Support


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.

Name: 0Gravity Weapon Lock Version: 1.0 Framework: Standalone Library dependency: 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.

Join the support Discord:

ox_lib
ox_lib
https://discord.gg/YbuNXpwkWY