How to make chase and kill script with pathfinding?

I want to make piggy based game, but i dont know how to make ai. How to make it? :confused:

Thereโ€™s a lot of youtube videos about that. You can check it out.