Kind of like guard in the game Notoriety, they follow players and shoot them, but they don't get stuck on walls because they follow a path to get there.
I was thinking a script to see which path part the player is the closest to, then follow other paths to get there. But I don't know how to find distance between parts and players so I need help.
Thanks
There is always PathfindingService which allows for this exact behaviour. There is an article here that explains it. If you wish for me to explain it just comment on my answer and I will do so.