Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » Changing score so weird
- quick-key
-
Scratcher
23 posts
Changing score so weird
My browser / operating system: ChromeOS 14816.131.0, Chrome 103.0.0.0, No Flash version detected
The coins should increase by 1 if coins per click is 1. But it's changing by like tens/hundereds.
Can somebody tell me why is it doing this(open link):
https://files.catbox.moe/ha1gt6.webm
You can find the code right here:
https://scratch.mit.edu/projects/1314487855/editor
The coins should increase by 1 if coins per click is 1. But it's changing by like tens/hundereds.
Can somebody tell me why is it doing this(open link):
https://files.catbox.moe/ha1gt6.webm
You can find the code right here:
https://scratch.mit.edu/projects/1314487855/editor
if <answered?> then
Thank you!
end
- 10goto10
-
Scratcher
1000+ posts
Changing score so weird
The problem is that the clones of your coin sprite are also receiving the broadcast.
I made a remix that uses a ‘for this sprite only’ variable to make sure that only the coin sprite makes a clone, https://scratch.mit.edu/projects/1374579090/
I made a remix that uses a ‘for this sprite only’ variable to make sure that only the coin sprite makes a clone, https://scratch.mit.edu/projects/1374579090/
- quick-key
-
Scratcher
23 posts
Changing score so weird
The problem is that the clones of your coin sprite are also receiving the broadcast.
I made a remix that uses a ‘for this sprite only’ variable to make sure that only the coin sprite makes a clone, https://scratch.mit.edu/projects/1374579090/
Only the coin sprite makes a clone? That looks like it is. I only understand about:
Global variables - for all sprites, including clones.
Private variables - for one sprite, only its clones.
Last edited by quick-key (Aug. 23, 2026 20:06:26)
- 10goto10
-
Scratcher
1000+ posts
Changing score so weird
Only the coin sprite makes a clone?That’s right.
That looks like it is. I only understand about:I think you’ve got the right idea. A variable created ‘for this sprite only’ is a private variable for that sprite and any clone that is created gets its own private variable.
Global variables - for all sprites, including clones.
Private variables - for one sprite, only its clones.
- quick-key
-
Scratcher
23 posts
Changing score so weird
Only the coin sprite makes a clone?That’s right.That looks like it is. I only understand about:I think you’ve got the right idea. A variable created ‘for this sprite only’ is a private variable for that sprite and any clone that is created gets its own private variable.
Global variables - for all sprites, including clones.
Private variables - for one sprite, only its clones.
Got it.
- quick-key
-
Scratcher
23 posts
Changing score so weird
Only the coin sprite makes a clone?That’s right.That looks like it is. I only understand about:I think you’ve got the right idea. A variable created ‘for this sprite only’ is a private variable for that sprite and any clone that is created gets its own private variable.
Global variables - for all sprites, including clones.
Private variables - for one sprite, only its clones.
But why is the clones of coin sprite are also receiving the broadcast? I didn't put the broadcast in when I start as a clone event.
- 10goto10
-
Scratcher
1000+ posts
Changing score so weird
The way it was working, if there was a clone on the screen then it would have received the broadcast made by clicking on the stage.
If a player had clicked slowly enough and only had done a click when there were no coins on the screen then the counter would have only increased just one time per click. But if there were a lot of coins of the screen then each coin would have increased the counter by one.
Or are you asking a design question? "Why do clones start with event hats activated if they are started with all scripts stopped? If this is your question then I don't know. It's not actually consistent. To be consistent Clones should be created with all of the running scripts still running and all of the event hats active or else started with both disabled. But that's not how the Scratch Team wanted their software to work and it has endlessly caused confusion for people.
If a player had clicked slowly enough and only had done a click when there were no coins on the screen then the counter would have only increased just one time per click. But if there were a lot of coins of the screen then each coin would have increased the counter by one.
Or are you asking a design question? "Why do clones start with event hats activated if they are started with all scripts stopped? If this is your question then I don't know. It's not actually consistent. To be consistent Clones should be created with all of the running scripts still running and all of the event hats active or else started with both disabled. But that's not how the Scratch Team wanted their software to work and it has endlessly caused confusion for people.
- Discussion Forums
- » Bugs and Glitches
-
» Changing score so weird
