Auto Relocking Doors


#1

Does anybody know how to make doors close and lock again by themselves after a player opens them? I need this for an arena i’m building, where you teleport in, fight a lvl based encounter, then collect the key off the boss to exit. The door automatically removes the key upon opening, which is great, but when I reenter the arena, and get the key again, the door is still open so there is no use for the keys after it’s been opened the first time. The idea is a repeatable arena challenge quest where the player must defeat the boss in order to exit. Everything else is working so far with it, I just need that door to reclose. Any help is appreciated! Thanks.


#2

I’m guessing this is for NwN as opposed to NwN 2. See the scripting FAQs. Also Look at this pinned thread. Finally this should have been posted in a module building forum.

TR


#3

:+1:

    object oDoor = GetObjectByTag("ARENA_DOOR");
    AssignCommand(oDoor, ActionCloseDoor(OBJECT_SELF));
    SetLocked(oDoor, TRUE);

#4

Thank you! That works perfect!