Background loop coding problem

how do I do that?