How do I make a **looping** custom function?

As the title suggests, I cant figure out how to make a looping custom function qwq

Continue to help post