Complete Example Scripts: Difference between revisions
Jump to navigation
Jump to search
m
→Creating a Simple Toggle: Optimized with bool hinge
imported>JustinOther |
imported>JustinOther m (→Creating a Simple Toggle: Optimized with bool hinge) |
||
| Line 18: | Line 18: | ||
===Creating a Simple Toggle=== | ===Creating a Simple Toggle=== | ||
<source lang="papyrus"> | <source lang="papyrus">ScriptName SimpleToggle Extends ObjectReference | ||
ObjectReference Property HouseProperty Auto | ObjectReference Property HouseProperty Auto | ||
Bool bToggle ; The toggle variable. Initializes 'False'. | |||
Event OnActivate(ObjectReference akActionRef) | Event OnActivate(ObjectReference akActionRef) | ||
bToggle = !bToggle ; Set Bool to whatever it's not | |||
If bToggle ; True | |||
HouseProperty.Enable() ;Enable your house! | |||
Else ; False | |||
HouseProperty.Disable() ;Disable your house! | |||
Endif | |||
EndEvent</source> | |||
EndEvent | |||
</source> | |||
'''To make this script work''': Attach this script to an activator such as a button, lever, or container. | '''To make this script work''': Attach this script to an activator such as a button, lever, or container. | ||
===A Quest item you can drop and pick up again and set or reset objectives and Stages.=== | ===A Quest item you can drop and pick up again and set or reset objectives and Stages.=== | ||