title: How to Loop a script in gamemaker
body: <pre><code>cantSee = collision_line(x,y,obj_player.x,obj_player.y,obj_corner,false,true)
  canSee = !(collision_line(x,y,obj_player.x,obj_player.y,obj_corner,false,true))
  </code></pre>
  
  <p><strong>Define the loop as the following:</strong></p>
  
  <pre><code>    if cantSee {
          cantSeeTimer = cantSeeTimer +1
      }
  
      if cantSeeTimer &gt;60 {
          speed=0
          stopped=true
      } else {
          mp_potential_step(obj_player.x,obj_player.y,5,false)
      }
  
  }
  
  if stopped=true &amp;&amp; canSee {
      mp_potential_step(obj_player.x,obj_player.y,5,false)
      loop()
  }
  </code></pre>
  
  <p>I know the language is bad, but I just want to create a loop command to summon at will.</p>
  
  <p>Thanks, Finn.</p>