SetLockLevel - ObjectReference: Difference between revisions

From the CreationKit Wiki
Jump to navigation Jump to search
imported>RJHelms84
m (Added lock level values for convenience.)
m (Convert source tags to syntaxhighlight)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
'''Member of:''' [[ObjectReference Script]]
'''Member of:''' [[ObjectReference Script]]


==Description==
Sets the level of the lock attached to this object. If there is no lock, it will attach one, but leave it unlocked.
Sets the level of the lock attached to this object. If there is no lock, it will attach one, but leave it unlocked.
The values to use are:
 
== Syntax ==
<syntaxhighlight lang="papyrus">
Function SetLockLevel(int aiLockLevel) native
</syntaxhighlight>
 
== Parameters ==
*aiLockLevel: The level to set the lock at.
** 1 = Novice
** 1 = Novice
** 25 = Apprentice
** 25 = Apprentice
Line 12: Line 18:
** 100 = Master
** 100 = Master
** 255 = Requires Key
** 255 = Requires Key
== Syntax ==
<source lang="papyrus">
Function SetLockLevel(int aiLockLevel) native
</source>
== Parameters ==
*aiLockLevel: The level to set the lock at.


== Return Value ==
== Return Value ==
Line 25: Line 23:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Set the lock to very easy
; Set the lock to very easy
WeakChestProperty.SetLockLevel(0)
WeakChestProperty.SetLockLevel(0)
Line 31: Line 29:
; Set the lock to needs key
; Set the lock to needs key
WeakChestProperty.SetLockLevel(255)
WeakChestProperty.SetLockLevel(255)
</source>
</syntaxhighlight>


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

Latest revision as of 20:20, 5 September 2026

Member of: ObjectReference Script

Sets the level of the lock attached to this object. If there is no lock, it will attach one, but leave it unlocked.

Syntax[edit | edit source]

Function SetLockLevel(int aiLockLevel) native

Parameters[edit | edit source]

  • aiLockLevel: The level to set the lock at.
    • 1 = Novice
    • 25 = Apprentice
    • 50 = Adept
    • 75 = Expert
    • 100 = Master
    • 255 = Requires Key

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Set the lock to very easy
WeakChestProperty.SetLockLevel(0)

; Set the lock to needs key
WeakChestProperty.SetLockLevel(255)

See Also[edit | edit source]