void main() { DelayCommand(20.0, ActionCloseDoor(OBJECT_SELF)); if (GetIsNight()){ ActionCloseDoor(OBJECT_SELF); SetLocked(OBJECT_SELF, TRUE); ActionSpeakString("The door is barred shut from the inside...perhaps if you came back during the day..."); return; } else DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); return; }