Since my script is too long I will provide a pastebin link to the code.

So I have this script for these NPCs, that they use to walk around in my game. However, despite having mapped out their entire walk paths, at times they will randomly skip going to blocks, which messes them up for the rest of the day (the script has them 'reset' at night by warping the NPC to a 'spawn' point at night) and gets them stuck however upon warping to the spawn and eventually beginning their morning routine runs the chance of the script jumping over bricks (which leaves this particular NPC stuck in her room for a long while). So I am wondering if it would be possible to change the script to do pathfinding, in hopes that it would prevent the skips or that it would figure out how to do what it is supposed to should it skip.

https://pastebin.com/6h61uWnH