- Documentation
- Server functions
- getPedAttackTarget
Function
getPedAttackTarget
Returns the element an NPC is currently attacking (set with setPedAttackTarget or picked by an aggressive NPC after being hurt). Returns false when the NPC is not fighting.
Syntax
element getPedAttackTarget(ped ped)Arguments
pedped- The NPC.
Returns
The attack target, or false.
Example
local target = getPedAttackTarget(ped)
if target then outputChatBox("NPC atakuje " .. getElementType(target)) end