How do i make a script that follow nodes in a folder by 1 to 30 and it repeats 1 to 30 again?

So uh im tryna make like something like, if a magnitude is like below than 15, and like it goes like 1 to 30 notes and repeats by a part coming below 15 magnitude to the node so it changes it to a new node to go. how do i that?

Iterate the children of the folder of nodes using a for loop, not a for i, v in pairs loop. If there is 30 nodes, you would loop between the numbers 1 through 30 and get the node based off the number.
Inside each loop, you would use either a while loop or a repeat loop to wait until the entity (assuming an entity is following these nodes) is within 15 studs of the node it’s walking to. To make the entity walk, use Humanoid:MoveTo. You can use Humanoid.MoveToFinished:Wait() to yield until the humanoid stops moving. Be aware that the move function stops after 8 seconds if the humanoid didn’t reach it’s destination.

Can you give a step-by-step example of how this would work with like three “nodes”? Also, what are you trying to make at a high level?