Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to ask and wait number of seconds?
- jamol91
-
1 post
How to ask and wait number of seconds?
I want my scratch to ask a question and wait for user answer a given number of seconds and give next question. There is ask and wait block in Sensing but I cannot set how many seconds it is allowed to wait. Any workarounds? Please help.
Last edited by jamol91 (April 22, 2014 13:08:18)
- GoldeScratcher
-
34 posts
How to ask and wait number of seconds?
I'm not sure if there is a way to do this, but I'll check it out.
- drmcw
-
1000+ posts
How to ask and wait number of seconds?
You can't do that with the ask block, only the user can end an ask block by pressing enter or clicking the tick. You'd have to write your own ask block to achieve that.
- Tramcrazy
-
100+ posts
How to ask and wait number of seconds?
Instead of using the ask block try using something like this. For an explanation look at the workaround section of this wiki page. then just stop the script after the given time.
- MeDiaMond
-
500+ posts
How to ask and wait number of seconds?
You can do it this way I think:
I hope this helps. Good luck!
It's a bit expensive cause you need one script for each question but it should be possible…
I hope this helps. Good luck!

- MasterCard786
-
100+ posts
How to ask and wait number of seconds?
You can do it this way I think:It's a bit expensive cause you need one script for each question but it should be possible…
I hope this helps. Good luck!
This is the best you can do.
You cannot go to the next question! Unless you have different sprites and each sprite says a different question but that would still leave the writing down answer thingy still there.
- TheLogFather
-
1000+ posts
How to ask and wait number of seconds?
The only way to get rid of ask-and-wait from script is with “stop all”. Not exactly useful… 
Personally, I'd like to see it go away when a script in the same sprite reaches “stop other scripts in sprite” - that would be kinda handy, and I suspect it would break hardly any existing projects if that change was made…
However, there is a way to work around the current limitation using the timer - I've just thrown together a little demo project:
http://scratch.mit.edu/projects/21056899/
Enjoy!

Personally, I'd like to see it go away when a script in the same sprite reaches “stop other scripts in sprite” - that would be kinda handy, and I suspect it would break hardly any existing projects if that change was made…
However, there is a way to work around the current limitation using the timer - I've just thrown together a little demo project:
http://scratch.mit.edu/projects/21056899/
Enjoy!
Last edited by TheLogFather (April 22, 2014 21:38:05)
- MeDiaMond
-
500+ posts
How to ask and wait number of seconds?
I suggested a ask and wait for () secs block. Here's the link: http://scratch.mit.edu/discuss/topic/36583/?page=1#post-305847 

- QuinnD2006
-
38 posts
How to ask and wait number of seconds?
hey what if you did
Last edited by QuinnD2006 (Aug. 4, 2015 20:42:44)
- deck26
-
1000+ posts
How to ask and wait number of seconds?
That's not what was asked for. They wanted the question to only be asked for a limited time, not the answer only being shown for a limited time. Try this:
That should work!
- coke11
-
1000+ posts
How to ask and wait number of seconds?
Oh like this sorry i did not understand 1st:
- coke11
-
1000+ posts
How to ask and wait number of seconds?
That's not what was asked for. They wanted the question to only be asked for a limited time, not the answer only being shown for a limited time. Try this:
That should work!
Oh i don't know then.
- TheLogFather
-
1000+ posts
How to ask and wait number of seconds?
As I said above, there is currently only *one way* to remove ask-and-wait…
Other suggestions above have included “stop other scripts in sprite”.
This will not work.
Another idea that you might think to try would be to ask in a different clone, then delete that clone.
That also does not work.
I would like to see Scratch changed so that both of above *do* work, since you would intuitively expect them to.
However, until then, if you want to create a cancel button for ask-and-wait, or show it for a limited time, you have to use “stop all”, unfortunately.
(I've suggested this topic be closed, since it has been answered.)
Other suggestions above have included “stop other scripts in sprite”.
This will not work.

Another idea that you might think to try would be to ask in a different clone, then delete that clone.
That also does not work.

I would like to see Scratch changed so that both of above *do* work, since you would intuitively expect them to.
However, until then, if you want to create a cancel button for ask-and-wait, or show it for a limited time, you have to use “stop all”, unfortunately.
(I've suggested this topic be closed, since it has been answered.)
Last edited by TheLogFather (Aug. 8, 2015 09:24:28)
- Discussion Forums
- » Help with Scripts
-
» How to ask and wait number of seconds?