NWNWiki
Advertisement
NWNWiki
3,718
pages

Closing a door automatically is quite simple. However there is one thing to keep in mind. Closing doors can become very annoying to the players. I suggest only closing doors that are area transitions or lead into a large area. Also you will want to make the delay before it closes reasonable. This way PCs aren’t constantly opening the same door so they can fight a creature that is on the other side.

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. OBJECT_SELF represents the object that the script is attached to. In this case, the door.


/////////////////////////////////////////////////////////
// Auto-Close Door
/////////////////////////////////////////////////////////
void main()
{
	DelayCommand(15.0f,ActionCloseDoor(OBJECT_SELF));
}
// End
Advertisement