Kill AI Number of Times?

thats why what i showed is just an example. if you need a different number for each level then you just need a way to set the number on a per level basis or create the script in another location.theres two easy ways to accomplish this:

first in the level bp on begin play get the game mode then cast as shown above then use a get all of class (enemy) and set the variable enemy count to the last index of the array returned by get all of class.

the second option would be to create a actor that stores the script and gets placed in each level. so instead of having the script in the game mode you would have another actor that takes care of this script. the issue with this method would be that your need to have the enemies reference the actor, this isnt all that hard but is more of an annoyance. a way around this problem would be to use a interface if you know how to use those.

again there are many ways to go about things and this is not a comprehensive list. you could also use tags for example. there is no method i know of to bind a event to every enemy dieing, so you need to create logic and communication to do the task. hell you could get all actors of class on tick and check the array length, but that would run terribly so dont do that.