I dont get the logic.
For a 'every X seconds' to work its needs to check its time kinda every tick.
Lets say its must fire every 2 seconds. First tick it sets that time, next ticks its askinig the system "is it time yet". And when it reads 2 seconds, it will fire and reset the clock.
You would do the same, keeping an eye on that watch.
A function gets called. Then it runs one moment. The containing events and actions dont get called/checked/compared/activated again till the next call. So that 'every x seconds' aint gonna do one thing.
If you need that timer, use a real timer. Outside the function. Thats a behaviour. Start a timer with a specifiek tag in layout start up. Use a 'on timer' condition. And bring in there that whole on locate function. No need to call it, it calls itself when it is time. The on failed path is then not needed to.
If you want it to it to find a path 2 second after it has sight on the player. Then make the 'has LOS' a top event. And start the timer in there. Make the inverted to stop the timer.
'on arrived' is not needed, because the timer will catch that.
Thanks for replying! I understand what you're saying, and I guess I don't need the timer. So I removed it, which makes my code better, but the enemies still don't follow the player. Do you know how I could fix it? Would having the file help, like the other person asked for?
Edit: I'll upload the file tomorrow.
Edit 2: And I should mention, when I removed the timer I moved the actions that were on it to the event above it.