Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Close and lock doors

From NWNWiki

Jump to: navigation, search

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 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
Rate this article:
Share this article: