abstract
| - This can be done with the script above with just on added line of code. Keep in mind that the door can’t lock until after it is closed. So the Lock command must be delayed as well. Add this script to the doors OnOpen script handle. Change the number 15.0f to whatever. This is the delay in seconds before the door closes. The Word TRUE will lock the door. FALSE will Unlock the door. OBJECT_SELF represents the object that the script is attached to. In this case, the door. ///////////////////////////////////////////////////////// // Auto-Close Door / Lock Door ///////////////////////////////////////////////////////// void main() { DelayCommand(15.0f,ActionCloseDoor(OBJECT_SELF)); DelayCommand(15.5f,SetLocked(OBJECT_SELF,TRUE)); } // End
- This can be done with the script below with just an added line of code. Keep in mind that the door can't lock until after it is closed. Therefore, the Lock command must be delayed as well. Add this script to the door's OnOpen script handle. Change the number 600.0f to any number; this is the delay in seconds before the door closes. The Word TRUE will lock the door. FALSE will Unlock the door. OBJECT_SELF represents the object that the script is attached to--in this case, the door. ///////////////////////////////////////////////////////// // Auto-Close Door / Lock Door ///////////////////////////////////////////////////////// void main() { DelayCommand(600.0f,ActionCloseDoor(OBJECT_SELF)); DelayCommand(600.5f,SetLocked(OBJECT_SELF,TRUE)); } // End Builders might note that doors that close and lock a short period of time after being opened can impact combat, as the door's closing may separate party members, block ranged attacks, or prevent repositioning. Even outside combat, quickly re-locking doors can annoy players, particularly when spells, thieves' tools, or other items are required to re-open a just-opened door.
|