Jump to content

gate lever script


zepprith

Recommended Posts

i am making a gate that is locked and the only way to open it is to use a lever a pretty simple concept i used the light switch scripted on the elderscrolls wiki because it seemed pretty much like the same action to me but when i use the lever it disappears along with the gate it opens

 

here is the scripted i used

 

 scn OrcGateLever
ref parent

Begin OnActivate
set parent to getParentRef
if GetDisabled == 0
	if parent != 0
		if parent.getDisabled == 0
			parent.disable
		else
			parent.enable
		endif
	endif
	disable
else
	if parent != 0
		if parent.getDisabled == 0
			parent.disable
		else
			parent.enable
		endif
	endif
	enable
endif
End

Link to comment
Share on other sites

The gate and switch are disappearing because the script you are using disables the switch and gate. Replace the script with this one:

 

Begin [Whatever name you want to give your script in one word]

Ref Parent

Begin OnActivate

Set Parent to GetParentRef
Playgroup Forward 0

If Parent.GetLocked
  Parent.Unlock
EndIf

End

 

Make sure you are attaching the script to a new object reference, as opposed to a reference which already exists in Oblivion. Ohterwise, you will cause problems.

Link to comment
Share on other sites

thanks for telling me to make i new object reference but when i try and save the script it tells me to add a script name so i do it but then i try and save again and i get Nested begin/end box are not allowed
Link to comment
Share on other sites

It's because of that "begin" on top of the script. It should be "scn" or "scriptname", like this:

Scn [ScriptNameHere]

Ref Parent

Begin OnActivate

Set Parent to GetParentRef
Playgroup Forward 0

If Parent.GetLocked
  Parent.Unlock
EndIf

End

Link to comment
Share on other sites

Wait, it says it's missing a scriptname? If there's a line saying "Scn [scriptname]", for example "Scn MyScript" (without quotes, of course) on the first line of the script, it shouldn't say that. Check again, that line might be missing.
Link to comment
Share on other sites

Sorry, that's what happens when you don't check what you've written.

 

Anyway, I agree with Argomirr. If you're using his revised script, there shouldn't be any problems. Try copy-paste that script into the CS then replace [scriptNameHere] with the name you want.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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