GetCombatTarget - Actor
Revision as of 17:22, 19 April 2012 by imported>Leonfenten (→Examples)
Member of: Actor Script
Obtains the actor this actor is currently in combat with.
Syntax
Actor Function GetCombatTarget() native
Parameters
None.
Return Value
The actor this actor is currently in combat with (if any).
Examples
; Print a message if Bob is in combat with the player
if (Bob.GetCombatTarget() == Game.GetPlayer())
Debug.Trace("Bob is in combat with the player!")
endIf
; Below will only return a valid actor ID while your
; cursor is pointing directly on an actor
TargetRef = Game.GetPlayer().GetCombatTarget()
Debug.Trace("My target was " + TargetRef)