Background for Fallout 4
Member of the ObjectReference script
voidfunctionAddKeyIfNeeded(ObjectReferenceObjectWithNeededKey)

[DEV SERVER] Loading description...


Caveats


Parameters

ObjectReferenceObjectWithNeededKey

CK Wiki Description

The reference that is locked with a key. It will create a key to this object and add it to the calling object if the calling object doesn't already have one.


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__ObjectWithNeededKey

myObjectReference__toCallFunctionOn.AddKeyIfNeeded(myObjectReference__ObjectWithNeededKey)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.