Alternative way to get all aggroed enemies is by using the EntityList with the filter "aggro".
The Aggrolist sits on the Index of the EntityList and can be directly accessed by:
localaggrolist=EntityList.aggrolistif ( aggrolist ) thenlocali,entity=next(aggrolist)
while (i~=nilandentity~=nil) do-- the 'd' command is a global command for printing out information into the consoled("Index: "..tostring(i).." EntityID : "..tostring(entity.id).." EntityAggro : "..tostring(entity.aggropercentage))
locali,entity=next(aggrolist,i)
endend
Attributes of the Aggrolist entries
id
Returns EntityID "number".
aggropercentage
Returns the amount of aggro of this Entity towards the Player "number".