How to make pathfinding more natural

I want to make so the npcs dont move all in one straight line, and add a bit of random “offset” if you get what i mean

you could probably do something like this

while npc is pathfinding do
   local randomcooldown = math.random(x,y)
   task.wait(randomcooldown)
   make the npc walk slightly to the side or something and resume pathfinding once it's done
end