Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Stop button detection
- SargentPorkchop
-
Scratcher
28 posts
Stop button detection
Hello, I've seen projects that have something happen after someone hits the stop button by the green flag. I'm not sure how it's done but It would be really handy to know. Thank you for your time and consideration.
- drmcw
-
Scratcher
1000+ posts
Stop button detection
when [Timer v] > (1)
Will still fire. If the project keeps resetting the timer when it's running then when the stop button is hit then the timer will no longer reset and your script is then free to run.
- cadoodle
-
Scratcher
11 posts
Stop button detection
There is an article about ths on the scratch wiki: http://wiki.scratch.mit.edu/wiki/Action_After_Stop
- SargentPorkchop
-
Scratcher
28 posts
Stop button detection
Thank you guys so much I did something similar but it didn't work because it was like this:
when green flag clicked
forever
reset timer
end
when green flag clicked
forever
if <(timer) > [ 0.5]> then
Do stuff
end
end
Last edited by SargentPorkchop (April 18, 2015 14:35:10)
- gtoal
-
Scratcher
1000+ posts
Stop button detection
Thank you guys so much I did something similar but it didn't work because it was like this:https://scratch.mit.edu/projects/58656772/when green flag clicked
forever
reset timer
endwhen green flag clicked
forever
if <(timer) > [ 0.5]> then
Do stuff
end
end
- SargentPorkchop
-
Scratcher
28 posts
Stop button detection
Thank you so much actually this helps me a lot!Thank you guys so much I did something similar but it didn't work because it was like this:https://scratch.mit.edu/projects/58656772/when green flag clicked
forever
reset timer
endwhen green flag clicked
forever
if <(timer) > [ 0.5]> then
Do stuff
end
end
- DREWNOLT
-
Scratcher
100+ posts
Stop button detection
Sorry for necroposting,(this was the only forum i could find that was still open about this) but is there a way to detect the stop button without using the timer?
- ScratchLetters2020
-
Scratcher
100+ posts
Stop button detection
Sorry for necroposting,(this was the only forum i could find that was still open about this) but is there a way to detect the stop button without using the timer?
You can create a new topic rather than necroposting.
I don't think there's any way to detect stop button without using the timer.
- Gage_Rage
-
Scratcher
39 posts
Stop button detection
Sorry for necroposting,(this was the only forum i could find that was still open about this) but is there a way to detect the stop button without using the timer?
You can create a new topic rather than necroposting.
I don't think there's any way to detect stop button without using the timer.
?
wdym- owl6464
-
Scratcher
1 post
Stop button detection
There is an article about ths on the scratch wiki: http://wiki.scratch.mit.edu/wiki/Action_After_StopThanks, this helped me a lot.
- WindowsAdmin
-
Scratcher
1000+ posts
Stop button detection
Now let's let this dieThere is an article about ths on the scratch wiki: http://wiki.scratch.mit.edu/wiki/Action_After_StopThanks, this helped me a lot.
- cysuser1
-
Scratcher
3 posts
Stop button detection
NO MORE STOP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you guys.
- HappyKid54321
-
Scratcher
100+ posts
Stop button detection
I used to have this problem too! There are multiple ways you can do this, but here's the simplest:
in any sprite/backdrop, do this:
Then in the sprite(s) that will be triggered when the stop button is pressed, add this:
in any sprite/backdrop, do this:
when green flag clicked
forever
reset timer
end
Then in the sprite(s) that will be triggered when the stop button is pressed, add this:
when [Timer v] > (0)
then whatever you want to happen when the stop sign is clicked
- Yesan2015
-
Scratcher
3 posts
Stop button detection
Do stuff[scratchblocks]
when green flag clicked
forever
reset timer
when [ timer] > (0.1)
end
[/scratchblocks]
Last edited by Yesan2015 (Sept. 15, 2025 16:48:39)
- Discussion Forums
- » Help with Scripts
-
» Stop button detection