Targets#=AI Get Entity Count Targets(Team2S1)
If Targets#>1
AI Set Entity Run Away When Hit Team2S1
AI Set Entity Speed Team2S1,70
AI Set Entity Can Attack Team2S1,0
Else
AI Set Entity Aggressive Team2S1
AI Set Entity Speed Team2S1,50
AI Set Entity Can Attack Team2S1,1
EndIf
Text 0,50,"Targets ("+STR$(Targets#)+")"
I'm using the code above to get the enemy to run away from the Allies as soon as it targets more than one ally. But, instead of the enemy running away, he continues to fight the allies. So I tried taking away the ability for the enemy to attack the allies, but now it just stays still in a idle position. Any suggestions?