Discuss Scratch

-NewGame-
Scratcher
18 posts

Stopping forever commands without a "Stop" script

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.

Hello I'm -NewGame- and if your reading this then you're cool
when green flag clicked
say [Hello and you're cool]
set [User v] to [cool]
say [You're welcome]
if <[User] = (cool)> then
say [Thanks for reading]
end
deck26
Scratcher
1000+ posts

Stopping forever commands without a "Stop" script

Don't understand the question. Are you saying the stop all doesn't work? Share the project if so please.
-NewGame-
Scratcher
18 posts

Stopping forever commands without a "Stop" script

Sorry, I meant
stop [this script v]
I suspect that it's blocking the script but I'm not sure.

Hello I'm -NewGame- and if your reading this then you're cool
when green flag clicked
say [Hello and you're cool]
set [User v] to [cool]
say [You're welcome]
if <[User] = (cool)> then
say [Thanks for reading]
end
deck26
Scratcher
1000+ posts

Stopping forever commands without a "Stop" script

-NewGame- wrote:

Sorry, I meant
stop [this script v]
I suspect that it's blocking the script but I'm not sure.
Still don't know what you're asking - that will stop the script.
TechNerd64
Scratcher
100+ posts

Stopping forever commands without a "Stop" script

deck26 wrote:

-NewGame- wrote:

Sorry, I meant
stop [this script v]
I suspect that it's blocking the script but I'm not sure.
Still don't know what you're asking - that will stop the script.
I think he's talking about exiting the loop. Like a loop break

Founder of Gigabyte Games, and apart of the EvolvusOS Team for OSWars 10. I mainly work on games and other interesting projects, but you can find me in the forums from time to time.
-NewGame-
Scratcher
18 posts

Stopping forever commands without a "Stop" script

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

Hello I'm -NewGame- and if your reading this then you're cool
when green flag clicked
say [Hello and you're cool]
set [User v] to [cool]
say [You're welcome]
if <[User] = (cool)> then
say [Thanks for reading]
end
Daniakh16
Scratcher
4 posts

Stopping forever commands without a "Stop" script

نحن سكراتش المتفوق
Daniakh16
Scratcher
4 posts

Stopping forever commands without a "Stop" script

نحن سكراتش المتفوق
deck26
Scratcher
1000+ posts

Stopping forever commands without a "Stop" script

-NewGame- wrote:

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
What 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.
-NewGame-
Scratcher
18 posts

Stopping forever commands without a "Stop" script

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?

Hello I'm -NewGame- and if your reading this then you're cool
when green flag clicked
say [Hello and you're cool]
set [User v] to [cool]
say [You're welcome]
if <[User] = (cool)> then
say [Thanks for reading]
end

Powered by DjangoBB