BrokenSwords Posted November 25, 2010 Share Posted November 25, 2010 Hello, Darryl here. Could someone help me sort this script out. I'm making house mod that's in the gameworld and not a seperate cell but I don't know how to auto lock a door, I know a little of scripting but not a lot. The door has a key for the player only, there's already a script in the game that allows NPC's to auto lock doors but it stops the player, I have taken this and modiified it to what I thought would work but alas it doesn't. I've attached a picture of thier script (top) and my modifed script (bottom). I hope I get some replies. Yours truely.Darryl. Link to comment Share on other sites More sharing options...
deepside Posted November 29, 2010 Share Posted November 29, 2010 If i'm right then the set openstate 0 is used to close the door.I'm not great at scripting but maybe this might work.. :unsure: Begin OnActivate if isActionRef Player == 1lock 2SetOpenState 1 else if isActionRef Player == 0lock 2SetOpenState 0 Activate endifendif end hopefully this works Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted November 29, 2010 Share Posted November 29, 2010 I would just put a trigger box on each side of the door that locks it when you walk through it. No one ever said I was an elegant man. Link to comment Share on other sites More sharing options...
maxrsp Posted December 1, 2010 Share Posted December 1, 2010 (edited) Hey Darryl, I had the same need awhile ago and used the OnClose function as a trigger to reset the lock status (255). Any item that has an animated close sequence can use the OnClose function. I will post a copy of my super simple script tonight when I get home from work. Edited December 1, 2010 by maxrsp Link to comment Share on other sites More sharing options...
thc1234 Posted December 1, 2010 Share Posted December 1, 2010 how about begin OnActivate if IsActionRef player Activate endif end NPCs won't be able to open doors with that script (nor they will be able to close them). Link to comment Share on other sites More sharing options...
maxrsp Posted December 2, 2010 Share Posted December 2, 2010 (edited) So, what I did was create a duplicate door form and added the following script: Scn ModAutoLock Begin OnClose ModMyArmoryDoor ModMyArmoryDoor.Lock 255 End I then used this object and set it to be default locked and associated it with a key. I've seen this done a bunch of different ways; they all worked but few were this elegant ;) Edited December 2, 2010 by maxrsp Link to comment Share on other sites More sharing options...
Recommended Posts