caleb68 Posted December 31, 2016 Share Posted December 31, 2016 without trying your script, the problem I see with it is when the player opens the door, it will automatically close and lock on them rather then only locking when the door is closed, hense why I used the event 'OnClose' instead of 'OnActivate', that way the door will only lock if its closed, and will remain open until then. No, it does not do this - it`s a toggle.It does something only when player activates it, one action at a time. Either closes and locks or unlocks and opens. Activating = pressing "E" on the door. I tested it in the game as this is a script I`m using for my settlements just without a lock level and key. Without lock level it won`t let to unlock it with some certain key so for using key need to set a lock level. yes I understand that, but for instance - if you have a object that unlocks the door but doesn't activate it, then when the player opens the door it will flip shut and lock again, likewise, if the door wasn't originally locked, when the player opens the door, it will flip shut and lock. As long as your door is locked to begin with, and nothing is used to just 'unlock' the door but not open it, then all is fine and dandy. Link to comment Share on other sites More sharing options...
kitcat81 Posted December 31, 2016 Share Posted December 31, 2016 (edited) yes I understand that, but for instance - if you have a object that unlocks the door but doesn't activate it, then when the player opens the door it will flip shut and lock again, likewise, if the door wasn't originally locked, when the player opens the door, it will flip shut and lock. As long as your door is locked to begin with, and nothing is used to just 'unlock' the door but not open it, then all is fine and dandy. I understood you. Yes, If you attach the script in the moment the door was closed, but not locked, you`ll have to click it twice to open it, but only the first time after attaching the script. I have bool set in the settlement door that makes it locked when crafted. Edited December 31, 2016 by kitcat81 Link to comment Share on other sites More sharing options...
Rattlerx5150 Posted December 31, 2016 Author Share Posted December 31, 2016 I was actually wrong, decided to test it as I was curious why it won`t work for you. My script works for Covenant doors if adding a locklevel of Covenant doors to it which is zero. Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() If Self. IsLocked() == false Self.SetOpen(false) Self.Lock() SetLockLevel(0) else Self.UnLock() Self.SetOpen() EndIf EndIf EndEvent without trying your script, the problem I see with it is when the player opens the door, it will automatically close and lock on them rather then only locking when the door is closed, hense why I used the event 'OnClose' instead of 'OnActivate', that way the door will only lock if its closed, and will remain open until then. Compilation failed Link to comment Share on other sites More sharing options...
kitcat81 Posted January 1, 2017 Share Posted January 1, 2017 I was actually wrong, decided to test it as I was curious why it won`t work for you. My script works for Covenant doors if adding a locklevel of Covenant doors to it which is zero. Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() If Self. IsLocked() == false Self.SetOpen(false) Self.Lock() SetLockLevel(0) else Self.UnLock() Self.SetOpen() EndIf EndIf EndEvent without trying your script, the problem I see with it is when the player opens the door, it will automatically close and lock on them rather then only locking when the door is closed, hense why I used the event 'OnClose' instead of 'OnActivate', that way the door will only lock if its closed, and will remain open until then. Compilation failed It failed because there is a space that appeared after copypasting. Should be "Self.IsLocked()" without space between them. Link to comment Share on other sites More sharing options...
Rattlerx5150 Posted January 1, 2017 Author Share Posted January 1, 2017 THAT WORKED!!! works exactly the way I want it to Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts