Difference between revisions of "OnLockStateChanged - ObjectReference"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Goggle
(→‎Examples: Event is sent for doors locked by default as the game locks them when loading into the cell. See notes.)
imported>Goggle
m (Undo revision 6156 by Twilight Sky (talk))
 
Line 22: Line 22:
endEvent
endEvent
</source>
</source>
== Note ==
* Doors that are locked by default are not locked when the player is not in the cell. When loading into the cell, then the door is locked. An unfortunate side effect to this is that this event will be sent as a result due to the door switching its lock state to whatever the default is when loading into the cell, making it unreliable. If you wish to do something when the door is unlocked by the player, use [[OnOpen - ObjectReference]] as a possible alternative.


== See Also ==
== See Also ==

Latest revision as of 06:32, 16 September 2016

Member of: ObjectReference Script

Event called when the lock on this object's state changes. (Locked, unlocked, level changed, etc)

Syntax[edit | edit source]

Event OnLockStateChanged()

Parameters[edit | edit source]

None.

Examples[edit | edit source]

Event OnLockStateChanged()
  if IsLocked()
    Debug.Trace("We are locked!")
  endIf
endEvent

See Also[edit | edit source]