- Found in:
- Vanilla
Description
Wiki Description
Checks this object's inventory for a key used by the parameter ObjectWithNeededKey. If this object does not have the key, it creates it and adds it to its inventory.
Documentation Comment
Adds a gets the key for the given locked reference and adds it to this reference's inventory
Parameters
ObjectReferenceaLockedRef
Examples
; Creates a key to BobsDoorRef and puts it in BobRef's inventory if BobRef doesn't already have that key in his inventory.
BobRef.AddKeyIfNeeded(BobsDoorRef)Auto-Generated Example
ObjectReference myObjectReference__aLockedRef
myObjectReference__toCallFunctionOn.AddKeyIfNeeded(myObjectReference__aLockedRef)Related Pages
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
