Skip to content

A premium-quality, highly optimized secret door system for RedM servers. Create hidden passages, trapdoors, and secret entrances with smooth animations, sound effects, and flexible access control (Target or DrawText3D).

License

Notifications You must be signed in to change notification settings

Blaze-Scripts/bs-secretdoors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bs-secretdoors

A premium-quality, highly optimized secret door system for RedM servers. Create hidden passages, trapdoors, and secret entrances with smooth animations, sound effects, and flexible access control (Target or DrawText3D).

Video Demonstration

BS-SecretDoors Demo

Watch the video demonstration to see bs-secretdoors in action! The video showcases:

  • Secret bookcase doors in action
  • Trapdoor functionality
  • Both ox_target and DrawText3D interaction methods

Click the image above to watch the full demonstration on YouTube.

Features

  • Advanced Door Animations: Smooth, customizable door animations with proper easing functions for realistic movement
  • Multiple Rotation Types: Support for both simple heading rotations and complex axis-based rotations for trapdoors and sliding panels
  • Sound Effects: Authentic RedM sound effects with reliable resource management
  • Flexible Access Control: Restrict doors by job, item, or both
  • Performance Optimized: Adaptive detection system that minimizes resource usage
  • Flexible Interaction: Support for both ox_target and native DrawText3D interactions
  • Server Synchronization: All door states are synchronized across all players
  • Admin Commands: Reset all doors with the resetdoors command (admin only)
  • Debug Mode: Comprehensive debug mode for easy troubleshooting
  • Reliable State Management: Door states persist correctly when players move in and out of range
  • Robust Login Detection: Automatically synchronizes door states when players join the server

Why Choose bs-secretdoors?

  1. Superior Performance: Optimized code with efficient resource usage and reduced overhead
  2. Reliability: Robust door state synchronization that works consistently across all scenarios
  3. Flexibility: Configure any type of secret door - from bookcase doors to trapdoors
  4. Professional Code Quality: Clean, well-documented code following Blaze Scripts best practices
  5. Framework Agnostic: Works with any framework
  6. Complete Solution: No need for additional resources or scripts
  7. Free and Open Source: Premium quality without the premium price tag KAPPA

Important Notice

If you are using ox_target, you can use item / job restrictions in the config. If you are using DrawText3D, you can implement job and item restrictions in client.lua for your framework.

Installation

  1. Ensure you have the following dependencies:

    • ox_target (optional - can be disabled in config)
  2. Download or clone this repository into your resources folder

  3. Add ensure bs-secretdoors to your server.cfg

  4. Configure your doors in config.lua

  5. Restart your server

Configuration

Door Types

The script supports two types of door rotations:

  1. Heading Rotation: Simple rotation around the vertical axis (typical doors)
rotation = {
    type = "heading",
    from = 90.0,
    to = 180.0
}
  1. Axis Rotation: Complex rotation around any axis (trapdoors, sliding panels)
rotation = {
    type = "rotation",
    axis = "x", -- x, y, or z
    from = 0.0,
    to = -90.0,
    fixedRotation = {y = 0.0, z = 165.0} -- Fixed rotation for other axes
}

Full Example

Config.Doors = {
    -- Saint Denis bookcase
    [1] = {
        coords = vector3(2858.86279296875, -1194.91650390625, 47.9914436340332), -- Door coordinates
        model = "s_clothingcasedoor01x", -- Door model
        isOpen = false, -- Initial state (false = closed)
        entityHandle = nil, -- Entity handle (managed by script)
        jobs = false, -- ox_target only: false = no job restriction, or use table like { 'vallaw', 'rholaw', 'blklaw', 'strlaw' },
        items = false, -- ox_target only: false = no item required, or use table like { 'key_bookcase' },
        rotation = {
            type = "heading", -- heading or rotation
            axis = "x", -- x, y, z
            from = 90.0, -- Starting rotation
            to = 180.0, -- Ending rotation
            fixedRotation = {x = 0.0, z = 0.0} -- Fixed rotation values for other axes
        }
    },
}

Job and Item Restrictions

This resource supports access restrictions based on jobs and items. You'll need to implement the validation logic for your specific framework:

For ox_target Mode

When using ox_target, the job and item restrictions are made directly in the config for each door.

-- ox_target only:

-- No restrictions
jobs = false,
items = false,

-- Job restrictions
jobs = { 'vallaw', 'rholaw' },
items = false,

-- Item restrictions
jobs = false,
items = { 'key_bookcase' },

-- Both job and item restrictions
jobs = { 'vallaw' },
items = { 'key_bookcase' },

For DrawText3D Mode

When using DrawText3D, you'll need to implement the validation logic in the DrawText3D interaction loop. Look for the commented section with in client.lua (Line ~400):

-- Check job/item restrictions
local canInteract = true

-----------------------------------------------------------
-- Job restriction check would go here
-- Item restriction check would go here
-----------------------------------------------------------

Framework Implementation Examples

DISCLAIMER: The following code examples are conceptual and provided for reference only. They are not plug-and-play solutions and will require adaptation to work with your specific framework version and server configuration. Use them as a starting point for your own implementation.

VORP Example

For VORP Core, you might implement job and item checks in the DrawText3D interaction loop like this:

-- In the DrawText3D interaction loop where canInteract is checked:

-- Job restriction check for VORP
if door.jobs then
    local Character = VORPcore.getUser(source).getUsedCharacter
    local playerJob = Character.job
    local hasJob = false
    
    for _, job in pairs(door.jobs) do
        if playerJob == job then
            hasJob = true
            break
        end
    end
    
    if not hasJob then
        canInteract = false
        TriggerEvent("vorp:TipBottom", "You don't have the right job to use this door", 4000)
    end
end

-- Item restriction check for VORP
if door.items and canInteract then
    local count = VORPInv.getItemCount(source, door.items[1])
    local hasItem = false
    
    for _, item in pairs(door.items) do
        if VORPInv.getItemCount(source, item) > 0 then
            hasItem = true
            break
        end
    end
    
    if not hasItem then
        canInteract = false
        TriggerEvent("vorp:TipBottom", "You don't have the required key", 4000)
    end
end

Commands

  • /doorinfo - Shows information about all configured doors (debug mode only)
  • /resetdoors - Resets all doors to closed state (admin only)

Compatibility

This resource is designed to work with:

  • RedM latest build
  • Any Framework (VORP, RSG, ...)
  • Optional: ox_target

πŸ”— Links

Support

For support, feature requests, or bug reports, please join our Discord.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details. Attribution appreciated. Don’t resell without consent.

About

A premium-quality, highly optimized secret door system for RedM servers. Create hidden passages, trapdoors, and secret entrances with smooth animations, sound effects, and flexible access control (Target or DrawText3D).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages