Stopping forever commands without a "Stop" script
id: 749921
category: Help with Scripts
posts: 10
Mar 24, 2024 17:41:16
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
-NewGame-
loading
when green flag clicked
set [stop v] to [0]
wait (5) secs
broadcast [Walk v]
wait (10) secs
broadcast [Stop v]
when I receive [Walk v]
forever
switch costume to [Walk v]
repeat (5)
next costume
end
wait until <(stop) > [50]>
stop [all v]
end
when I receive [Stop v]
set [stop v] to [60]
This is what my code looks right now and I know something is wrong with it but I don't know what it is, so help please.
Mar 24, 2024 17:52:23
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
deck26
loading
Don't understand the question. Are you saying the stop all doesn't work? Share the project if so please.
Mar 24, 2024 18:02:13
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
-NewGame-
loading
Sorry, I meant
stop [this script v]I suspect that it's blocking the script but I'm not sure.
Mar 24, 2024 18:10:57
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
deck26
loading
Still don't know what you're asking - that will stop the script. Sorry, I meantstop [this script v]I suspect that it's blocking the script but I'm not sure.
Mar 24, 2024 18:36:59
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
TechNerd64
loading
I think he's talking about exiting the loop. Like a loop breakStill don't know what you're asking - that will stop the script. Sorry, I meantstop [this script v]I suspect that it's blocking the script but I'm not sure.
Mar 24, 2024 18:50:48
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
-NewGame-
loading
The code where it says “When I receive: Stop, set stop to 60” does work when triggered but when “Stop this script” is activated it's being blocked by something and isn't going in order after the stop variable supposedly goes over 50. That's what I meant by I think its blocking the rest of the script
Mar 24, 2024 18:50:51
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
Daniakh16
loading
نحن سكراتش المتفوق
Mar 24, 2024 18:55:06
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
Daniakh16
loading
نحن سكراتش المتفوق
Mar 24, 2024 19:49:16
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
deck26
loading
being blocked by something and isn't going in order after the stop variable supposedly goes over 50. That's what I meant by I think its blocking the rest of the scriptWhat does the bit I've underlined mean? Is the script being stopped or not? The whole script will be stopped - it can't break out of a forever loop and continue with code after that. Code after a forever loop will never be run once the forever loop is triggered - you either let the forever loop continue or you stop the script completely. The code where it says “When I receive: Stop, set stop to 60” does work when triggered but when “Stop this script” is activated it's
Mar 24, 2024 20:45:37
Stopping forever commands without a "Stop" script
view on scratch
view on legacy ocular
-NewGame-
loading
I thought about where you said “you either let the forever loop continue or you stop the script completely.” And had an idea. Does repeat commands work? If they can run for a certain amount of time could they open up a possibility?