I am trying to create a script for an activator using a switch (GenElecSwitch01 in GECK) which I have linked to a door (CabinMainDoor in GECK) to lock and unlock the door (So my companions can't just wander off and monsters can't just stroll in). I found this script online:
SCN LockDoorScript
Ref MyLink
Begin OnActivate
Set MyLink to GetLinkedRef
If MyLink.getOpenstate == 1
MyLink.setopenstate 0
MyLink.Lock 255
ElseIf MyLink.GetOpenState == 0
MyLink.Unlock
MyLink.SetOpenstate 1
EndIf
END
Since I am a complete novice when it comes to scripting, could someone please help me out and tell me how to get this to work? I am pretty sure that I need to replace 'MyLink' with the door's ref id or something but if someone could please clarify that it would be great. Thanks.