lynxcali Posted February 25, 2011 Share Posted February 25, 2011 (edited) Okay so I have a prison, and it uses a special key, but if I unlock it once, it becomes unlocked forever so the prisoners can easily just leave. How can I make it so that it becomes locked every time I close it? Does this require a script? Edited February 25, 2011 by lynxcali Link to comment Share on other sites More sharing options...
The_Vyper Posted February 25, 2011 Share Posted February 25, 2011 Okay so I have a prison, and it uses a special key, but if I unlock it once, it becomes unlocked forever so the prisoners can easily just leave. How can I make it so that it becomes locked every time I close it? Does this require a script?If you set ownership of the door to PlayerFaction, you will be able to open it without a key even while it's locked. No one else will be able to open the door unless: 1.) They have the key. 2.) They're part of the PlayerFaction or whatever faction you set the door ownership to. Link to comment Share on other sites More sharing options...
Hickory Posted February 25, 2011 Share Posted February 25, 2011 And if you want 'peace of mind' and a touch of realism, you could create a locking spell with a script effect like so: scn LockDoorSpell ref door Begin ScriptEffectStart Set door To GetSelf If door.isActor == 0 If door.getLockLevel < 99 door.Lock 100 Endif Endif End Begin ScriptEffectFinish Message "The door is locked" End Link to comment Share on other sites More sharing options...
lynxcali Posted February 25, 2011 Author Share Posted February 25, 2011 Okay so I have a prison, and it uses a special key, but if I unlock it once, it becomes unlocked forever so the prisoners can easily just leave. How can I make it so that it becomes locked every time I close it? Does this require a script?If you set ownership of the door to PlayerFaction, you will be able to open it without a key even while it's locked. No one else will be able to open the door unless: 1.) They have the key. 2.) They're part of the PlayerFaction or whatever faction you set the door ownership to. Strange because the NPC's were opening it... Link to comment Share on other sites More sharing options...
lynxcali Posted February 25, 2011 Author Share Posted February 25, 2011 (edited) And if you want 'peace of mind' and a touch of realism, you could create a locking spell with a script effect like so: scn LockDoorSpell ref door Begin ScriptEffectStart Set door To GetSelf If door.isActor == 0 If door.getLockLevel < 99 door.Lock 100 Endif Endif End Begin ScriptEffectFinish Message "The door is locked" End So do I just attach this script to the door or is this a spell I have to cast on the door every time I want to lock it?EDIT: Okay wow im dumb, I didnt even see that you said spell :P Do you have a script I can attach to the door instead? This is for a mod and I dont want to make it a hassle to lock the door every time you know? Edited February 25, 2011 by lynxcali Link to comment Share on other sites More sharing options...
Hickory Posted February 25, 2011 Share Posted February 25, 2011 It's a casting spell, to give you the impression that you're locking the door. Link to comment Share on other sites More sharing options...
lynxcali Posted February 25, 2011 Author Share Posted February 25, 2011 It's a casting spell, to give you the impression that you're locking the door. Nice. Do you have a script I can attach to the door instead though? That will lock the door when its closed? Link to comment Share on other sites More sharing options...
fg109 Posted February 26, 2011 Share Posted February 26, 2011 Assuming you have doors that open and close instead of moving you to another cell: scriptname AutoLockDoorScript Begin GameMode if (GetOpenState == 3) if (GetLocked == 0) Lock 100 endif endif End Link to comment Share on other sites More sharing options...
lynxcali Posted February 26, 2011 Author Share Posted February 26, 2011 Assuming you have doors that open and close instead of moving you to another cell: scriptname AutoLockDoorScript Begin GameMode if (GetOpenState == 3) if (GetLocked == 0) Lock 100 endif endif End Thank you fg109, much appreciated. Link to comment Share on other sites More sharing options...
The_Vyper Posted February 26, 2011 Share Posted February 26, 2011 Okay so I have a prison, and it uses a special key, but if I unlock it once, it becomes unlocked forever so the prisoners can easily just leave. How can I make it so that it becomes locked every time I close it? Does this require a script?If you set ownership of the door to PlayerFaction, you will be able to open it without a key even while it's locked. No one else will be able to open the door unless: 1.) They have the key. 2.) They're part of the PlayerFaction or whatever faction you set the door ownership to. Strange because the NPC's were opening it...If you have the key in your inventory, the door will be unlocked when you go through it and then anyone can open it. If you don't have the key, then only you and those belonging to the owning faction will be able to go through it. Link to comment Share on other sites More sharing options...
Recommended Posts