Get AI’s current hate target||doc135585

September 20, 2022


  • The class to which the function belongs:AIControl


Get the current AI's aggro target.

Value Returned

type Description
Entity Entity, priority: 1. The entity with the highest hatred value 2. When the active attack is turned on, the closest target

Code Samples

on the entity object servermount script, get the current AI's hate target

local control = this:getAIControl()
local enemy = control:getEnemy()