Jump to content

Do Papyrus recognize If with SetOpen?


Wolfstorm

Recommended Posts

Or I'm doing something wrong? 

There are two statues, set with initially disabled. 

Then you have two levers, each lever enable one statue. 

Then you have a pull-bar, to open a gate. 

The gate will only open if the two statues are in place. 

So you pull the two levers, use the pull bar and that's it, gate opened. 

But Papyrus is not recognizing the IF. It just open the gate already at start, with or without the statues in place, it makes no difference. 

Here is the script: 

Quote

 

Scriptname PuzzlePullBar extends ObjectReference

ObjectReference Property Object1 Auto
ObjectReference Property Object2 Auto
ObjectReference Property Gate Auto

Event onActivate (objectReference triggerRef)

If (Object1 == IsEnabled() && Object2 == IsEnabled())
    Gate.SetOpen()
Endif    

EndEvent

 


Removing the ( after the IF had no effect. Using "and" in place of "&&" will not compile. 

The SetOpen works both with a door, a gate, or a traplinker (for gates that uses movable spikes). 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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