Jump to content

Auto Lock Script


kingtitan

Recommended Posts

I am no scripter, unfortunately and I making a mod where I could really use a "Auto Lock" script for a door controlled by a lever. Basically whenever I close the door via the lever, I want it to lock back to its previous state. Right now, without a script, the door opens and closes via the lever, but it doesn't lock back when i activate the lever to close the door. My only option right now is to console lock it every time i shut it. Any help would be GREATLY appreciated.
Link to comment
Share on other sites

I am no scripter, unfortunately and I making a mod where I could really use a "Auto Lock" script for a door controlled by a lever. Basically whenever I close the door via the lever, I want it to lock back to its previous state. Right now, without a script, the door opens and closes via the lever, but it doesn't lock back when i activate the lever to close the door. My only option right now is to console lock it every time i shut it. Any help would be GREATLY appreciated.

Try something like this:

 

scn DoorAutoLockScript

Short Open

Begin OnActivate

 If open != 1
   DoorRef.Unlock
   DoorRef.Activate
   Set Open to 1
 Elseif Open == 1
   DooRef.Activate
   DoorRef.Lock LockLevel
   set open to 0
 Endif

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...