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).
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.
- 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
resetdoorscommand (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
- Superior Performance: Optimized code with efficient resource usage and reduced overhead
- Reliability: Robust door state synchronization that works consistently across all scenarios
- Flexibility: Configure any type of secret door - from bookcase doors to trapdoors
- Professional Code Quality: Clean, well-documented code following Blaze Scripts best practices
- Framework Agnostic: Works with any framework
- Complete Solution: No need for additional resources or scripts
- Free and Open Source: Premium quality without the premium price tag KAPPA
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.
-
Ensure you have the following dependencies:
- ox_target (optional - can be disabled in config)
-
Download or clone this repository into your resources folder
-
Add
ensure bs-secretdoorsto your server.cfg -
Configure your doors in
config.lua -
Restart your server
The script supports two types of door rotations:
- Heading Rotation: Simple rotation around the vertical axis (typical doors)
rotation = {
type = "heading",
from = 90.0,
to = 180.0
}- 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
}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
}
},
}This resource supports access restrictions based on jobs and items. You'll need to implement the validation logic for your specific framework:
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' },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
-----------------------------------------------------------
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.
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/doorinfo- Shows information about all configured doors (debug mode only)/resetdoors- Resets all doors to closed state (admin only)
This resource is designed to work with:
- RedM latest build
- Any Framework (VORP, RSG, ...)
- Optional: ox_target
- π§Ύ GitHub: Blaze-Scripts/bs-secretdoors
- π¬ Support & Feedback: Join our Discord
- π More Free Scripts: Blaze Scripts
For support, feature requests, or bug reports, please join our Discord.
This project is licensed under the MIT License - see the LICENSE file for details. Attribution appreciated. Donβt resell without consent.
