Jump to content

How do I set up a relockable gate


gunslinger6792

Recommended Posts

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

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

 

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

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.jpg
door1 by lesher6792, on Flickr

Link to comment
Share on other sites

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 by gunslinger6792
Link to comment
Share on other sites

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

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

I'll give it a go thank you.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...