Here are two scripts that do the same thing different ways. One you use as the door script and will work with any switch/keypad etc like a normal remote door.
The other you use as the switches script and use with a normal remote door. This is mainly for those flipflop switches with the locked/open textures, as the door script one does not reset the switch to locked when the player moves away. This one does.
As the scripts close the doors depending how far away the player is, place your switch/keypad on the door frame (or next to it) to make it work right.
These are to different ways to do it, do not use both scripts at the same time, or you will get door flapping city lol
Airlock script for remote door:
;Artificial Intelligence Script
;Header
desc = Airlock Door (opens remote, closes when player moves away)
;Triggers
; door opens on switch/keypad
:state=0,activated=1:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
; door closes when player is 75 units away)
:state=2,plrdistfurther=75:activate=0,state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=0,setframe=0
;End of Script
Airlock script for on off switch:
;Artificial Intelligence Script
;Header
desc = Airlock Switch (opens on press and closes when player moves away)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=50:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=50,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,plrusingaction=0:state=2
;player is further than 75 units switch resets and closes the door
:state=2,plrdistfurther=75:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10
;End of Script
Of course place a switch either side of each door and give both the same door to operate. It does not matter how many doors you have, 1/2/3/4....