Difference between revisions of "HasKeyword - Form"

Jump to navigation Jump to search
49 bytes added ,  16:08, 16 September 2012
m
Removed erroneous note. Native functions don't have to be defined in any script.
imported>DiemCarpe
imported>JustinOther
m (Removed erroneous note. Native functions don't have to be defined in any script.)
Line 18: Line 18:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
Scriptname ExampleScript
ScriptName ExampleScript Extends ObjectReference


Keyword Property DoomKeywordProperty auto
Keyword Property DoomKeywordProperty Auto


; Does this object have a doom keyword?
Event OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akFormReference, ObjectReference akSourceContainer)
if (NiceSwordProperty.HasKeyword(DoomKeywordProperty))
If akBaseItem.HasKeyword(DoomKeywordProperty) ; Does the added object have a doom keyword?
; Note: You do not need to state the function's syntax in your script
Debug.Trace("The added sword is a doom sword")
; to be able to use the function
EndIf
  Debug.Trace("The nice sword is a doom sword")
EndEvent
endIf
</source>
</source>


== See Also ==
== See Also ==
*[[Form Script]]
*[[Form Script]]
Anonymous user

Navigation menu