Safe System

Safe System for RSGCore (RedM)

This script is a safe storage system designed for RedM using the RSGCore framework. It allows players to create, place, and use safes to store their items securely.


:small_blue_diamond: Features

  • Create a safe using a command (/createsafe) or an item (stash_creator).
  • Customizable safeswith:
    • Custom name
    • Adjustable weight and slots
    • Optional password protection
    • Different safe models
  • Smooth placement system:
    • Players can move the safe before confirming the location.
    • Press E to confirm the placement.
  • Storage system integration:
    • Safes act as stash inventories.
    • Password-protected safes require a correct code to open.
  • Persistent data storage:
    • Safes are saved in the database (vault table in MySQL).
    • Safes remain after server restarts.
  • Target system integration (rsg-target):
    • Interact with safes using a targeting system.
    • Open safes via an NUI-based input.

:small_blue_diamond: Configuration (config.lua)

The config.lua file allows customization of:

  • Framework & Dependencies (rsg-core, rsg-target).
  • Default safe properties (weight, slots).
  • Command and item-based creation.
  • Key bindings (Confirm placement with E).
  • Text localization (Safe messages & prompts).

b4c2f71c8fe473555278d271e3f2fcd8553d6db4.png


:small_blue_diamond: How It Works

:one: Creating a Safe

  • Players can use:
    • The command (/createsafe).
    • The safe item (stash_creator).
  • A form appears, allowing the player to set:
    • Safe name, weight, slots, password, and model.
  • After confirming, the player can move the safe before placing it.
  • Press E to confirm the placement.

:two: Storing & Retrieving Items

  • Players interact with the safe using the targeting system (rsg-target).
  • If the safe has a password, the player must enter it.
  • If the password is correct:
    • The inventory system opens (inventory:server:OpenInventory).
    • The player can store and retrieve items.

:three: Data Persistence

  • Each safe is saved in the MySQL database (vault table).
  • The server script loads safes on player login or restart.

:small_blue_diamond: Dependencies

This script requires: