Space Engineers

Space Engineers

649 ratings
Whip's Auto Door and Airlock Script
File Size
0.005 MB
Mar 30, 2015 @ 5:34pm
Jul 31, 2018 @ 7:25pm
42 Change Notes ( view )

Subscribe to download
Whip's Auto Door and Airlock Script

In 1 collection by Whiplash141
Whip's Scripts
15 items
ATTENTION: This script triggers itself automatically. No timers needed!

"Sure, I could turn around and close the door like a civilized man.
Or I could let a robot do it for me... like a modern man.
    - Acarii on the virtues of automatic doors

This script will close any door once it has been open for over 4 seconds (15 seconds for hangar doors). The duration that a door is allowed to be open is independent of the status of any other doors. This is to say that if I open one door at a certain time then open another door a second later, each door will stay open for 4 seconds, then close. This script also supports an INFINITE amount of simple airlock systems.

  1. Place this script in a programmable block
  2. (Optional) Set up airlock systems
If you don't want/need the airlock functionality, only step (1) is necessary!

Auto Door Closer
The script will fetch ALL doors on the grid and automatically close any
door that has been open for 3 seconds. Doors can also be excluded from
this feature.

Excluding Doors:
  • Add the tag "Excluded" anywhere in the door's name.
  • Set the variable "ignoreAllHangarDoors" to true in the code if you want all hangar doors to be ignored by the auto door closing function
This script supports the optional feature of airlock systems. Airlock systems are composed of AT LEAST one Interior Door AND one Exterior Door. The airlock status lights and sound blocks do not affect the functionality of the doors so if you don't have space for them, don't fret :)

  • Interior doors should be named like so: "[Prefix] Airlock Interior"
  • Exterior doors should be named like so: "[Prefix] Airlock Exterior"
  • (Optional) Airlock status lights should be named like so: "[Prefix] Airlock Light"
  • (Optional) Airlock Sound Block should be named like so: "[Prefix] Airlock Sound"
  • The "[Prefix]" is the unique name that you group your airlock doors by

    Example Names
    • "Main Airlock Interior" and "Main Airlock Exterior"
    • "[Main] Airlock Interior" and "[Main] Airlock Exterior"
    • "Potato Airlock Interior" and "Potato Airlock Exterior"
    • "1337 Airlock Interior" and "1337 Airlock Exterior"
  • An airlock system is composed of at least one Interior Door and one Exterior Door. You can have more than one of each type of door. If you do not have one or more Interior and Exterior doors in your airlock system, that particular system will be ignored.
  • Doors with the same prefix are linked together in an airlock system
  • You do not need an airlock light for the doors to function properly
  • For each airlock system, if an Interior Door is opened, all Exterior Doors are locked and vice versa
  • Each airlock system operates independently of others

This is my first script, I hope y'all enjoy! :)

Thanks to LordTylus for the script in his Self-Maintaining Survival Ship (no longer available :( ) that I based the logic of the auto door closing on. (Very spiffy design :) )

If you have any questions, comments, or concerns, feel free to leave a comment on
the workshop page
- Whiplash141 :)
Popular Discussions View All (5)
Aug 17, 2019 @ 12:42pm
PINNED: Bug Reports
Jul 14, 2019 @ 7:04pm
Feature Requests
Apr 15, 2018 @ 1:57pm
How can I setup an Airvent to work with this?
< >
ZettDeEff May 30 @ 5:39pm 
Did you enabled "In-Game scripting" in the advanced options for the savegame? ;-)
cpwachs May 21 @ 2:24pm 
I seem to be having an issue with this Mod. It used to work for me, I started a new world, loaded this in the PB and it does, nothing. Its like the code isn't there.
patrick.heney May 11 @ 7:27am 
Does this work across connectors? For example, this is setup and running in building A, which is connected via a connector to building B. Will it control the doors on building B? I have this configuration now, but it isn't working.
en3he Apr 20 @ 7:15pm 
:HentaiGirlLinda_correct: & :HentaiGirlLinda_star: & :HentaiGirlLinda_like:
chrishoule1366 Apr 3 @ 5:41pm 
hi Whiplash so far this works great however im curious if there is a way to increase the time airlock doors stay open just the airlock not other doors bc the airlock im using is a gate from frostbite and it seems the code picks this as a door
crimsonlich Apr 3 @ 3:19am 
Hi Whip, Love the script.
I was wondering if there was a way to change how long the locked door of an airlock stays "locked", since people keep leaving before the vent is done depressurizing.
Blaidd Drwg Mar 22 @ 12:39pm 
First of all, I really like your script.
However, the gates introduced by the Frostbite DLC are classified as doors by your script. They automatically close after the four seconds, or whatever value you define as regularDoorOpenDuration . It's barely enough for them to fully open. As a workaround you can set the value to anything higher or exclude them.
Verek Mar 21 @ 10:03pm 
I don't know if this is just me but for whatever reason I can't copy this script into the programmable block anymore (after the recent update)
this is a script for doors. not a door
silentzoner Mar 3 @ 10:26am 
is this a 1 block airlock door or can you make one like this ?