How to make an event like this?
You can call the widget with the Create widget function, when your Custom event is happening. You would need something like health <= 0 to check if the AI is dead, then also use Destroy actor function, if required.
i kno but the thing is i have a multiple Ai in the level know this confuses me where should i create the function and what nodes should i use
Add it to the AI.
Add On Begin Play (Event)
New variable Set Health (float) 100 on Event BeginPlay
How does your AI die? When the AI is supposed to die or when you deal damage, reduce Health variable.
Add a node Branch to check then each time of Health is <= 0
Then add to the branch True output the create widget.
There are many tutorials and examples which discuss these type of nodes.