Jump to content

Lock/Unlock script


JAAR2604

Recommended Posts

Hello,

 

I am having trouble with scripting in the GECK. I've tried to make a script by myself for Locking and Unlocking doors.

I've tried so many times to do it, and everytime it didn't work.

Can someone help me?

I would like to have a script for Locking/Unlocking doors by the same Activator.

I don't like using a GUN for it, because it's much easier with an activator.

 

Some information:

• I don't have NVSE and FOSE

• The door I am using is: UtlDoorBg01

• I am not a scripting expert

• I am Dutch, so my English isn't that good

(• I have a Windows 7 Laptop)

 

Can someone please help me?

 

Thanks ^.^

Link to comment
Share on other sites

Hello,

 

I am having trouble with scripting in the GECK. I've tried to make a script by myself for Locking and Unlocking doors.

I've tried so many times to do it, and everytime it didn't work.

Can someone help me?

I would like to have a script for Locking/Unlocking doors by the same Activator.

I don't like using a GUN for it, because it's much easier with an activator.

 

Some information:

• I don't have NVSE and FOSE

• The door I am using is: UtlDoorBg01

• I am not a scripting expert

• I am Dutch, so my English isn't that good

(• I have a Windows 7 Laptop)

 

Can someone please help me?

 

Thanks ^.^

 

Start by making the door you want to lock/unlock a persistent reference. Create the activator you want to lock or unlock said door and attach THIS:

 

scn DummyLockUnlock

ref rDoor

Begin onActivate

Set rDoor to GetLinkedRef

if rDoor.GetLocked
	rDoor.Unlock
else
	if rDoor.GetOpenState
		rDoor.SetOpenState 0
	endIf
	rDoor.Lock 255
endIf

end

 

Then, set your activator's Linked Reference as the door you want to lock/unlock.

 

Edit: The script should be an Object script.

Edited by Xaranth
Link to comment
Share on other sites

  • Recently Browsing   0 members

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