GetKey - ObjectReference

From the CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Obtains the Key that unlocks this object (or None if the object does not have a key, or is not lockable).

Syntax[edit | edit source]

Key Function GetKey() native

Parameters[edit | edit source]

None.

Return Value[edit | edit source]

The Key that will unlock this object. If the object is not lockable, it will return None.

Examples[edit | edit source]

; Add the key to unlock this door to the player's inventory
Key JailKey = JailDoor.GetKey()
Game.GetPlayer().AddItem(JailKey)

See Also[edit | edit source]