AddKeyIfNeeded - ObjectReference: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Thingy Person
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
Function AddKeyIfNeeded(ObjectReference ObjectWithNeededKey)
Function AddKeyIfNeeded(ObjectReference ObjectWithNeededKey)
key NeededKey = ObjectWithNeededKey.GetKey()
key NeededKey = ObjectWithNeededKey.GetKey()
Line 15: Line 15:
EndIf
EndIf
EndFunction
EndFunction
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 24: Line 24:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Creates a key to BobsDoorRef and puts it in BobRef's inventory if BobRef doesn't already have that key in his inventory.
; 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)
BobRef.AddKeyIfNeeded(BobsDoorRef)
</source>
</syntaxhighlight>


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

Navigation menu