gunslinger6792 Posted August 11, 2013 Share Posted August 11, 2013 How do I set up a relockable gate without a computer? I know how to set up a relocking door using a terminal I did that in my last mod. What I'd like to do is set up a gate that can be locked from both sides possibly using switches. That way the character can lock the gate when the leave the area and when they enter. Link to comment Share on other sites More sharing options...
gunslinger6792 Posted August 12, 2013 Author Share Posted August 12, 2013 Anybody? If you need me to clarify any I'd more than happy to. Link to comment Share on other sites More sharing options...
jazzisparis Posted August 12, 2013 Share Posted August 12, 2013 Use this script with an activator. Link the activator to the door. scn CloseAndLockScript ref rDoor begin OnActivate if IsActionRef player set rDoor to GetLinkedRef if rDoor.GetOpenState == 1 rDoor.SetOpenState 0 rDoor.Lock 100 endif endif end Link to comment Share on other sites More sharing options...
gunslinger6792 Posted August 12, 2013 Author Share Posted August 12, 2013 Use this script with an activator. Link the activator to the door. scn CloseAndLockScript ref rDoor begin OnActivate if IsActionRef player set rDoor to GetLinkedRef if rDoor.GetOpenState == 1 rDoor.SetOpenState 0 rDoor.Lock 100 endif endif end Thank you very much :) Link to comment Share on other sites More sharing options...
gunslinger6792 Posted August 13, 2013 Author Share Posted August 13, 2013 Ok so i used the script that jazzerparris gave me and attached it to an electrical switch. I then linked the switch to the door. The switch however won't do anything. I'll get the message to pop up activate swtich but it won't do anything. So obviously I'm doing something wrong I just don't know what. I should mention the door is locked with a key incase that matters. http://farm4.staticflickr.com/3668/9502384433_977afe6775_c.jpgdoor1 by lesher6792, on Flickr Link to comment Share on other sites More sharing options...
DaemonGrin Posted August 13, 2013 Share Posted August 13, 2013 Just curious thought the switch was to lock a gate not a teleport door? The script may need to be different not sure though. Link to comment Share on other sites More sharing options...
gunslinger6792 Posted August 13, 2013 Author Share Posted August 13, 2013 (edited) Just curious thought the switch was to lock a gate not a teleport door? The script may need to be different not sure though.At the moment its actually linked to a teleport door. I'll link it to the gate I set up and see if it works. Realistically now that I've actually added a gate thats what I would want. Edit just tried and I can't get a linked reference to the gate itself the red cross hairs won't turn white. Edited August 13, 2013 by gunslinger6792 Link to comment Share on other sites More sharing options...
DaemonGrin Posted August 13, 2013 Share Posted August 13, 2013 Yeah uopn looking over Jazzs' script you need a different script for a teleport door. The one he wrote up for you is telling it to check that the door is open with the getopenstate == 1 if it is open then to close with the setopenstate 0 and tele doors don't actually open and close. For a switch t lock a tele door I would do something like scn CloseAndLockScript ref rDoor begin OnActivate if IsActionRef player set rDoor to GetLinkedRef if rDoor.GetLocked == 0 rDoor.Lock 100 endif endif end That should work just tweaked Jazzs' script a little. Good Luck,Geoff Link to comment Share on other sites More sharing options...
gunslinger6792 Posted August 13, 2013 Author Share Posted August 13, 2013 Yeah uopn looking over Jazzs' script you need a different script for a teleport door. The one he wrote up for you is telling it to check that the door is open with the getopenstate == 1 if it is open then to close with the setopenstate 0 and tele doors don't actually open and close. For a switch t lock a tele door I would do something like scn CloseAndLockScript ref rDoor begin OnActivate if IsActionRef player set rDoor to GetLinkedRef if rDoor.GetLocked == 0 rDoor.Lock 100 endif endif end That should work just tweaked Jazzs' script a little. Good Luck,GeoffI'll give it a go thank you. Link to comment Share on other sites More sharing options...
DaemonGrin Posted August 13, 2013 Share Posted August 13, 2013 Please note that I didn't change the script name so you may want to XD if you intend to use his closeandlockscript on the gate as well Link to comment Share on other sites More sharing options...
Recommended Posts