AI for NPCs and enemies

I need help with making a AI for the enemies and NPCs so they do random stuff but are affected by the same things the player is (pain, colliding, ect) I am making a game that is like terraria but different

Hello, Taco2009 and welcome!

I recommend two videos from Gdevelop’s official youtube channel:


There are more videos about enemies, and you can use this logic for your NPCS.

yeah I’ve tried them but the first one I do not understand