# Inserting a break by pausing the loop but it doesn't work on pavlovia

**URL:** https://discourse.psychopy.org/t/inserting-a-break-by-pausing-the-loop-but-it-doesnt-work-on-pavlovia/24133
**Category:** Online experiments
**Tags:** pavlovia
**Created:** [July 20, 2021, 12:57am UTC](https://discourse.psychopy.org/t/inserting-a-break-by-pausing-the-loop-but-it-doesnt-work-on-pavlovia/24133 "2021-07-20T00:57:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Barney](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barney](https://discourse.psychopy.org/u/Barney)
#### Post date: [July 20, 2021, 12:57am UTC](https://discourse.psychopy.org/t/inserting-a-break-by-pausing-the-loop-but-it-doesnt-work-on-pavlovia/24133/1 "2021-07-20T00:57:36Z")

</div>

URL of experiment:

Description of the problem: In pavlovia, I want participants to be able to have a break half way through the loop (so after 22 trials), but it only works on my local device. I cannot get it work when I pilot it in pavlovia. I am using a code that I found on this forum, but I guess it just doesn’t work for me and I have been hunting for a different one but with no luck. Below is a picture of the code I inserted in the pause routine (I placed the pause routine at the end of the loop …see picture below to see where I put the pause/code to pause the loop after 22 trials).

![codepic_forbreak](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/e/ee6da6a33149e198ab4591dee1107c7f9d567957.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/2/c20cf8d8765f64f60abce4d419b0fc008c09aaf2.png)

If anyone has a different idea that I haven’t tried, I would be very grateful for the information!!

Also, please let me know if this is not enough information to help you help me. I apologize, I am a bit new.

Thank you

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [July 20, 2021, 6:32am UTC](https://discourse.psychopy.org/t/inserting-a-break-by-pausing-the-loop-but-it-doesnt-work-on-pavlovia/24133/2 "2021-07-20T06:32:48Z")

</div>

.thisN doesn’t work online.

Change the code component to Both and replace the name of the loop with snapshot on the JavaScript side.

---

<div class="post-metadata">

### Author: ![Barney](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barney](https://discourse.psychopy.org/u/Barney)
#### Post date: [July 20, 2021, 10:20pm UTC](https://discourse.psychopy.org/t/inserting-a-break-by-pausing-the-loop-but-it-doesnt-work-on-pavlovia/24133/3 "2021-07-20T22:20:58Z")

</div>

Thank you so much @wakecarter!! This is the solution. I am really grateful for your help.
