How to make an AI open a level when overlaping player.

I’m trying to make an AI chase the player and when it catches it, it will take the player to a level, but its not working correctly, here is my code.


for damage and

for the AI.
if you can give me a better code, or a way to fix it, please let me know.

Update! I switched the level to generate a widget instead of the level, and it fixed.