Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » The most common error for newer Scratchers is...
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
The use of more than one of these blocks per project…
The problem is that when you are brand new to Scratch, your first projects are pretty simple. In projects like these, you can usually get away with using plenty of these blocks in one project without causing any extra errors. This leads people to begin making all their projects in this manner.
But eventually, you end up writing projects with ever bigger and more complicated scripts. The error I'm speaking of here manifests as weird, undiagnosable errors and a dual start state, which explains why you see so many projects urging you to “press the green flag again if something weird happens” or something like that.
What happens is that users get this idea that when that flag is clicked, all the scripts using this block start at the same time, but they don't. They actually fire off, like everything else in Scratch, one at a time. The problem is that they don't seem to start in the same order every time. So the more green flag clicked blocks you have going on at the immediate start of your project, such as variables being set in one place and used somewhere else, the higher the chance that this error will show up. It is usually caused when a variable is requested before it has been set.
I've been a Scratcher for over 5 years now, and this has been an issue since I joined. Please share this information with others because as I go through projects requesting help, I see this mistake more often than not.
I recently added the solution to the Scratch Wiki…
"Note: Using more than one of these blocks in a single project can create errors that are difficult to diagnose, often only appearing with every other start of the project. A simple solution is to use only one of these blocks followed by a broadcast to all other scripts that need to run when the project begins.
Replace all the other “when green flag clicked” blocks with these…
Your dual start state should go away. Any runtime errors that are still occurring are being caused by something else. When helping people with their projects, I often find that until they fix this mistake, it may be impossible to fix some other errors.
One of the main benefits of Scratch is the ability to study other people's projects. Find impressive projects and take a look inside at how those Scratchers do things. Over time, experienced programers develop a set of best practices that they use almost every time they write something. Even though some people think of Scratch as being simplistic, it is still malleable enough that one person's best practices may vary considerably from how someone else successfully does the same things, so dig deep and you will grow tall.
when green flag clicked
The problem is that when you are brand new to Scratch, your first projects are pretty simple. In projects like these, you can usually get away with using plenty of these blocks in one project without causing any extra errors. This leads people to begin making all their projects in this manner.
But eventually, you end up writing projects with ever bigger and more complicated scripts. The error I'm speaking of here manifests as weird, undiagnosable errors and a dual start state, which explains why you see so many projects urging you to “press the green flag again if something weird happens” or something like that.
What happens is that users get this idea that when that flag is clicked, all the scripts using this block start at the same time, but they don't. They actually fire off, like everything else in Scratch, one at a time. The problem is that they don't seem to start in the same order every time. So the more green flag clicked blocks you have going on at the immediate start of your project, such as variables being set in one place and used somewhere else, the higher the chance that this error will show up. It is usually caused when a variable is requested before it has been set.
I've been a Scratcher for over 5 years now, and this has been an issue since I joined. Please share this information with others because as I go through projects requesting help, I see this mistake more often than not.
I recently added the solution to the Scratch Wiki…
"Note: Using more than one of these blocks in a single project can create errors that are difficult to diagnose, often only appearing with every other start of the project. A simple solution is to use only one of these blocks followed by a broadcast to all other scripts that need to run when the project begins.
when green flag clicked
broadcast [initialize v] and wait
Replace all the other “when green flag clicked” blocks with these…
when I receive [initialize v]
Your dual start state should go away. Any runtime errors that are still occurring are being caused by something else. When helping people with their projects, I often find that until they fix this mistake, it may be impossible to fix some other errors.
One of the main benefits of Scratch is the ability to study other people's projects. Find impressive projects and take a look inside at how those Scratchers do things. Over time, experienced programers develop a set of best practices that they use almost every time they write something. Even though some people think of Scratch as being simplistic, it is still malleable enough that one person's best practices may vary considerably from how someone else successfully does the same things, so dig deep and you will grow tall.

Last edited by Locomule (Oct. 17, 2019 21:31:49)
- Awesomator8859
-
Scratcher
41 posts
The most common error for newer Scratchers is...
Thanks, I'm not sure if that is the problem though. The block
just doesn't work like it should on the online. Offline it works perfectly.
when this sprite clicked
just doesn't work like it should on the online. Offline it works perfectly.
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
I'm sure about the green flag block error. Like I said, it has been around for longer than 5 years now. I got the description of how the error works from a post by Paddle2See.
As for your error, I haven't noticed it as all my “when this sprite clicked” blocks work fine online. I suspect the problem is somewhere besides the block itself. Got a link to a project with this error I can look at? If I can confirm it is bugged, I'll add the nfo to the Scratch Wiki.
As for your error, I haven't noticed it as all my “when this sprite clicked” blocks work fine online. I suspect the problem is somewhere besides the block itself. Got a link to a project with this error I can look at? If I can confirm it is bugged, I'll add the nfo to the Scratch Wiki.
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
I am making an animated project about this but in the mean time, I'm bumping this because it is SO relevant. Just go look through all the projects on the front page suffering from this error. Plz use this information to improve your own projects and share it with others so they can do the same. It is kinda CRAZY that this is still such a huge problem an so few Scratchers know about it. 

- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
And for those inevitable doubters, take a look inside the Game Loop sprite of Griffaptch's tutorial project and let him explain it to you 

- asivi
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
in my opinion, the use of more than one of these blocks per project…when green flag clicked
The problem is that when you are brand new to Scratch, your first projects are pretty simple. In projects like these, you can usually get away with using plenty of these blocks in one project without causing any extra errors. This leads people to begin making all their projects in this manner.
But eventually, you end up writing projects with ever bigger and more complicated scripts. The error I'm speaking of here manifests as weird, undiagnosable errors and a dual start state, which explains why you see so many projects urging you to “press the green flag again if something weird happens” or something like that.
What happens is that users get this idea that when that flag is clicked, all the scripts using this block start at the same time, but they don't. They actually fire off, like everything else in Scratch, one at a time. The problem is that they don't seem to start in the same order every time. So the more green flag clicked blocks you have going on at the immediate start of your project, such as variables being set in one place and used somewhere else, the higher the chance that this error will show up.
I've been a Scratcher for over 5 years now, and this has been an issue since I joined. Please share this information with others because as I go through projects requesting help, I see this mistake more often than not.
I recently added the solution to the Scratch Wiki…
"Note: Using more than one of these blocks in a single project can create errors that are difficult to diagnose, often only appearing with every other start of the project. A simple solution is to use only one of these blocks followed by a broadcast to all other scripts that need to run when the project begins.when green flag clicked
broadcast [initialize v]
Replace all the other “when green flag clicked” blocks with these…when I receive [initialize v]
Your dual start state should go away. Any runtime errors that are still occurring are being caused by something. When helping people with their projects, I often find that until they fix this mistake, it may be impossible to fix some other errors.
One of the main benefits of Scratch is the ability to study other people's projects. Find impressive projects and take a look inside at how those Scratchers do things. Over time, experienced programers develop a set of best practices that they use almost every time they write something. Even though some people think of Scratch as being simplistic, it is still malleable enough that one person's best practices may vary considerably from how someone else successfully does the same things, so dig deep and you will grow tall.
when green flag clicked
broadcast [initialize v] and wait//add the wait to avoid chances of happening this issue
Last edited by asivi (Oct. 21, 2017 07:07:15)
- asivi
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Also you do not forget to update such wiki article
Thanks.
Thanks.Last edited by asivi (Oct. 21, 2017 07:07:44)
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Hi
Greets and welcome! This particular forum is for people getting help with their projects. But if you go over here and post again you will get a warmer reception as that is what that forum is for. Be sure to also check out the stickies posted at the top of that forum as it has a lot of helpful information for new Scraatchers. All forums have their own stickies to help us use them better.

- deck26
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Is there any reason to keep this topic open?Hi
Greets and welcome! This particular forum is for people getting help with their projects. But if you go over here and post again you will get a warmer reception as that is what that forum is for. Be sure to also check out the stickies posted at the top of that forum as it has a lot of helpful information for new Scraatchers. All forums have their own stickies to help us use them better.
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Is there any reason you aren't a moderator but are here trying to moderate my post? Please don't do that. If I wanted my topic closed, I'd close it, and I don't. This coding problem still persists and I'd say that is plenty of reason as I share a link to this post when necessary.
Just to clarify for anyone else, if you are not an official Scratch moderator, do not moderate my posts. If you feel they need to be moderated, report them, that is what the Report button is for. But otherwise please do not attempt to moderate me or the posts I make.
Just to clarify for anyone else, if you are not an official Scratch moderator, do not moderate my posts. If you feel they need to be moderated, report them, that is what the Report button is for. But otherwise please do not attempt to moderate me or the posts I make.
Last edited by Locomule (March 10, 2018 12:34:05)
- deck26
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Is there any reason you aren't a moderator but are here trying to moderate my post? Please don't do that. If I wanted my topic closed, I'd close it, and I don't. This coding problem still persists and I'd say that is plenty of reason as I share a link to this post when necessary.Ouch.
Just to clarify for anyone else, if you are not an official Scratch moderator, do not moderate my posts. If you feel they need to be moderated, report them, that is what the Report button is for. But otherwise please do not attempt to moderate me or the posts I make.
In other words the answer to my question is you prefer to keep it open. I wasn't trying to moderate, just asking a straightforward question!
You're on here often enough to know how much of a problem necroposting can be and how closing a topic can help reduce it. It's also easy to overlook the option to close. If you feel it needs to stay open that is obviously up to you.
- asivi
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
@Locomule, could you fix the original post(if you don't mind)? Thanks.
- Cameron_Johnson
-
Scratcher
100+ posts
The most common error for newer Scratchers is...
Is there any reason you aren't a moderator but are here trying to moderate my post? Please don't do that. If I wanted my topic closed, I'd close it, and I don't. This coding problem still persists and I'd say that is plenty of reason as I share a link to this post when necessary.Please no necroposting/spam. I think that's all he was trying to say. Nobody is moderating your posts. Everything will be okay. You can close the post if you are feeling overwhelmed.
Just to clarify for anyone else, if you are not an official Scratch moderator, do not moderate my posts. If you feel they need to be moderated, report them, that is what the Report button is for. But otherwise please do not attempt to moderate me or the posts I make.
- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
I'm not overwhelmed at all, no need to suggest so. Just like I don't need someone else to try to close my post because some new Scratcher randomly necroposted on it. Everything is fine here so unless you have something relevant to the topic of the post, the errors created by using too many Green Flag Clicked blocks in a single project, I'd ask that you not bring it up. Thanks.
Last edited by Locomule (March 10, 2018 16:51:59)
- BirdLover198
-
Scratcher
100+ posts
The most common error for newer Scratchers is...
Ahh I see, well this will definitely be helpful
#BUMP
#BUMP- Locomule
-
Scratcher
1000+ posts
The most common error for newer Scratchers is...
Oh yeah, when I first found out about this and thought of how many “press green flag twice” projects I'd seen I realized how big a problem this is and how crazy it is that so few people know about it. The broadcast and wait portion of the solution is the timing system I kept saying I wanted everyone doing code on our team to use. It is super simple and the combining it with custom blocks set to run fast is the key to making complex projects that still run smoothly, not to mention handling complex sprite collisions without error. When I was remaking PacMan on Scratch my mind was kinda blown when I discovered that rarely, under “perfect” conditions PacMan can go through a ghost. I had this problem a lot when I first began using Scratch with fast moving things like bullets but I never have it anymore.
You know what? I have been contemplating making some YouTube tutorials but when I ask around (elsewhere) no one seems interested. I bet this timing system would make a great tutorial. I could build it up from a simple system to a working platformer base. It would be great to have anyway because trying to explain it to someone here in text is often kinda meh..
You know what? I have been contemplating making some YouTube tutorials but when I ask around (elsewhere) no one seems interested. I bet this timing system would make a great tutorial. I could build it up from a simple system to a working platformer base. It would be great to have anyway because trying to explain it to someone here in text is often kinda meh..

- ABCs1
-
Scratcher
2 posts
The most common error for newer Scratchers is...
In WeDo 2.0, whenever I turn the light green, the light blinks yellow twice then stops. Then it blinks twice, then it stops. Do you know why this is happening?
- Discussion Forums
- » Help with Scripts
-
» The most common error for newer Scratchers is...








