[ STANDLONE | FREE | DISCONTINUED] Bank timed door closing

Information:

This script provides a simple and efficient automatic door locking system for your FiveM server. It allows you to define specific doors on the map that will automatically lock or unlock based on predefined time conditions. The script is designed to enhance the role-playing experience by adding realism to the environment.


Framework Compatibility:

Customizable Door Locking: Define the doors you want to lock or unlock by specifying their coordinates, object name, and heading in the configuration file.
Time-Based Control: Doors automatically lock and unlock at specific times of the day, providing a dynamic and immersive experience.
Notification System: Utilizes a notification function to inform players when doors are locked or unlocked, enhancing the user experience.
Error Handling: In case of issues, the script prints error messages to the server console, helping administrators identify and address potential door-related bugs.


Configuration Settings:
Adjust the following parameters in the configuration file (Config.lua) to suit your server’s needs:

  • LockDoorsAtCoords: Define the doors with their coordinates, object name, and heading that you want to lock.
  • Radius: Set the radius for finding the closest object of the specified type.
  • WaitTillNext: Adjust the wait time between checks for time-based door locking/unlocking.
  • WhitelistedTime: Specify hours when doors should be unlocked.
  • BlacklistedTime: Specify hours when doors should be locked.

Usage:

  1. Install the script on your FiveM server. (put in the server.cfg “start bs_banklock” and then refresh and start)
  2. Configure the doors and time settings in the Config.lua file.
  3. Ensure that players receive appropriate notifications when doors are locked or unlocked.
  4. Adjust the wait time based on the server’s performance and requirements.

Preview



There are currently only two Doors in the config mabye will add later the function that you can add doors by aiming at them just like the bs_doorram script :smiley:
bs_banklock.zip (2.5 KB)

Old Versions

Version 1.0
bs_banklock.zip (2.0 KB)


Other Scripts and Models

Other BS-Scripts
[ QBCORE | ESX | PAID] Door Ram Script
image

[ STANDLONE| FREE ] Camera Lock Script
image

[ ESX | FREE ] Burgershotjob Script
image

[ STANDLONE | PAID ] Gang Member Spawner Script
image

[PAID | ESX/QBCORE/STANDLONE | WIP] Border Control Job
image

[PAID | Add-On | Standlone ] Barbetta M9A3
image

[PAID | Add-On | Standlone ] Hecller und Koff G28
image

[PAID | Add-On | Standlone ] Tec-9
image

[PAID | ESX ] Blue Style Airsoft
image

[PAID | Add-On | Standlone ] Sig Sauer MPX
image

[Paid| ESX] BS-Robplanes
image

[PAID | Add-On | Standlone ] MK18 + Component
image

[PAID | Add-On | Standlone ] PPK + Component
image

[FREE | Standlone] New Bike Idle Anim
image

[PAID | Add-On | Standlone ] AK-12 + Component
image

[PAID | Add-On | Standlone ] MAC-10 + Component
image

[PAID | Add-On | Standlone ] P99 + Component + Weapon Wheel Image
image

[FREE | MLO ] Blue Style Paleto Electric MLO
image

[FREE | ESX ] Police Dashcam
image

[FREE | ESX ] BS car colour / car tinting
image

[PAID | PACK ] BS Everything
image

[PAID | Add-On | ESX | UPDATE ] Doorlock + Lockpicking Doorlock
image

[PAID | Add-On | Standlone ] Glock 30 with Attachments
image

[PAID | Add-On | Standlone ] UMP-45 with Attachments
image

[PAID | Add-On | Standlone ] M4A1 with Attachments
image

[PAID | Add-On | Standlone ] RPD
image

[PAID | Add-On | Standlone ] M249 with Attachments
image)

Blue Style MultiCars
image

[PAID | Add-On | Standlone ] Mossberg 590 with Attachments
image

[PAID | Add-On | Standlone ] Spas 18 - #5 by Blue_Style_DEV
image

[PAID | Add-On | Standlone ] Smith & Wasson M&P with Attachments
image

[PAID | Add-On | Standlone ] P90 with Attachments
image

[PAID | Add-On | Standlone ] Karabine 98k with Attachments
image

[Paid | Add-On | Standlone | Ped] Boblox Character
image

[PAID | Add-On | Standlone ] MP5A3 Attachments Fixxed Model
image

[PAID | Add-On | Standlone ] CheyTac M200 with Attachments
image

[PAID | Add-On | Standlone ] MP9 Attachments Fivem Ready
image

[PAID | Add-On | Standlone ] M16 with Attachments
image

[PAID | ADD-ON Weapon] Walther P88
image

[PAID | ADD-ON WEAPON] Weapon Barrett M107A1 - #3 by Blue_Style_DEV
image

[PAID | STANDLONE] Weapon Airsoft M1911
image

[PAID] BS-Chips ADDON PROPS Fivem Ready
image

[ESX | PAID] Blue Style Safe Car Script
image

Script is accessible Yes and No
Subscription-based No
Lines 56
Requirements None
Price free
7 Likes

is there any way to handle if someone is still inside? maybe stays there, had an reconnect and missed the time or something else

This is so good.
Configuring other doors than the original, i found a small problem.
If you are close to the doors, the doors are indeed closed.
If you go further away and come back, the doors are open
Mention that coords and hashes are correct

1 Like


fix ?

1 Like

i agree, be cool to have a job, i.e. police with ability to unlock/lock the doors during the time of closures.

You entered the wrong coordinates or the doors are not found. You need to copy the door coordinates, the door object name, i.e. the hash name and the heading of the door and then paste them into the configuration

added it for esx and qbcore

1 Like

curious, whats the best tool to get information from game into the script?
Just idgun?

Great for qbcore too

The problem is still there btw

idgun script or qb default entity option, or any entity options/script u have

You can modify this code in my bs_doorlock to print it and then create a command from it


function StartMainDoorlockLoop()
    Citizen.CreateThread(function()
        while true do
            if Doorlock then
                local IsFound, Object = GetEntityPlayerIsFreeAimingAt(PlayerId())

                if IsFound then
                    Doorlock = false -- Prevent Multiple Creation
                    local _,__,yaw = table.unpack(GetEntityRotation(Object))
                    
                    TriggerServerEvent("bs_doorlock:SaveOnConfig", yaw, GetEntityCoords(Object), GetEntityModel(Object), job, Object, distance, garage)
                    break
                end
            end
            Citizen.Wait(500)
        end
    end)
end
1 Like

If he misses the time and is locked inside, maybe you could make it an RP scenario or something like that, but no if the doors are closed they won’t open again until it’s in the whitelisted time. You could install a wait timer before the doors are closed and then a message like e.g. “WARNING the doors at the banks will close in … minutes or seconds” that would be possible to prevent it in most cases.

Or you aren´t close enough but in the picture i can see the fleeca bank so i think you set the coords wrong

Cant we just make door locks thats accessible to police?

however, I did that, via dolu_tools, copied the hash of the door and coordinates, added it to the config.

Hey wouldn’t be better to add compatibility with for example ox_door lock so everyone can add their doors + ways to unlock it (items/lockpock)

You can add it yourself as I am unable to do so at the moment due to personal reasons

1 Like

Can you help me make the police able to close it and open it during the ban? I would also like you to help me in the event of a closure. There will be an announcement in the chat above for players to know when the bank will open or close.

Thank you very much, very nicely done!

Change my config to Config.PoliceRadius = 2.0 it works fine

I have an idea for future versions:

  • A “central key” as an item that can open the doors despite the time lock, not only for jobs
  • Maybe create the white/backlist times in categories so you can decide for yourself when which area is closed. For example supermarket 8pm, Bolingbahn 10pm etc

Many thanks for your work! :hearts: @Blue_Style_DEV