Author Sticky: Post Working Scripts Here
Ratmaster2000 Posted: Monday, 01 July 07:01PM
1. Script name Door close AND lock
2. what it does: will close a door that has been open after 5 seconds passes then will lock the door.
3. Notes. Place this script in a door's "on open" event. also, check "can be relocked" if you want the door to always relock after successful unlock's and door openings.
4. the code is:

NWScript:
// -----------------------------------------------

// : File Door_closeanlck

// : Created 01 JUL 02 11:48 AM

// : Created by Darryl Sandell

// closes open door after set time

// and locks door.

// -----------------------------------------------

void main()

{

  DelayCommand(5.0, ActionCloseDoor(OBJECT_SELF));

  SetLocked(OBJECT_SELF, 1);

}


Okay someone asked for this in another post and as I got it to work I figured I would post it here and hope that it helps others.

_________________