Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Score counter not working
- edonald
-
4 posts
Score counter not working
I've added a score counting script but it's not working. The problem is that the score does not increase. What I want it to do is increase by 1 each time the main sprite touches various other sprites. Any ideas? Thanks.
- deck26
-
1000+ posts
Score counter not working
Sharing the project will make it easier to help.
- scratchinghead
-
1000+ posts
Score counter not working
Yup. Sharing the project will make it easier to help.
- edonald
-
4 posts
Score counter not working
Hi, that's the script I've used. I've shared it, it's called Save the unicorn. The aim is for the cat to dodge the ghoul and collect the unicorns. As each unicorn is collected I want the score to increase by 1.
- pencil2paper
-
1 post
Score counter not working
Hi, that's the script I've used. I've shared it, it's called Save the unicorn. The aim is for the cat to dodge the ghoul and collect the unicorns. As each unicorn is collected I want the score to increase by 1.
What @cooking101 said:
Does this work? Make sure to use the forever block or it won't work.

- deck26
-
1000+ posts
Score counter not working
Set Score to 0 in one green flag script - no need to do it multiple times.
Most of your ‘if touching’ scripts are run when the green flag is clicked and then are finished straight away as you don't have a forever loop around them.
Most of your ‘if touching’ scripts are run when the green flag is clicked and then are finished straight away as you don't have a forever loop around them.
- deck26
-
1000+ posts
Score counter not working
In at least one of the unicorns you have scripts telling it to hide when it touches the cat as well as telling it to change the score. You do have the forever loops in those scripts but you should combine into one script so the hide and score change are both in the same script.That would help reduce the number of scripts and make it easier to understand the project.
If the unicorns are detecting when they touch the cat you don't need the scripts getting the cat to do the same.
If the unicorns are detecting when they touch the cat you don't need the scripts getting the cat to do the same.
- edonald
-
4 posts
Score counter not working
Thanks for your input. Ok so I've made those changes. Now it works for unicorn 2 but none of the others. Also unicorn 2 no longer hides but the rest still do.
- deck26
-
1000+ posts
Score counter not working
In unicorn2 you have one forever loop inside another - never a good idea! You want one forever loop, one ‘if touching’ block and then do what you want when touching. Same for the others - one forever loop, one ‘if touching’. You have two ‘if touching’ blocks so you hide and then try to see if it is touching something else but a hidden sprite won't detect that it is touching a visible sprite.
- Troopy
-
1 post
Score counter not working
Score won't go up above 0. I've shared it. It's called Star Wars attempt 5 prototype I hope this works on scratch variables work on lives but not score???????
- anvanlaer
-
67 posts
Score counter not working
This is an old thread. Better is to make your own post so we can help you. Score won't go up above 0. I've shared it. It's called Star Wars attempt 5 prototype I hope this works on scratch variables work on lives but not score???????
- coldmonster
-
1 post
Score counter not working
I have created ‘catch the fruit game’ but when the fruit touches the basket the score is increasing randomly
- deck26
-
1000+ posts
Score counter not working
Please create your own topic rather than necroposting. I have created ‘catch the fruit game’ but when the fruit touches the basket the score is increasing randomly
Check your costumes - do the displayed sizes match what you expect? Are you changing score in a loop so it happens multiple times when you only want it to happen once?
- adsuri
-
1000+ posts
Score counter not working
Something like that.
Last edited by adsuri (June 25, 2018 21:20:12)
- deck26
-
1000+ posts
Score counter not working
Anything in this topic to do with unicorns is 3 years old, please check date before posting.Something like that.
- adsuri
-
1000+ posts
Score counter not working
Oh oops sorry.Anything in this topic to do with unicorns is 3 years old, please check date before posting.Something like that.
- MReidAIG
-
1 post
Score counter not working
I cant get my score to go up without going insanely rapid, or duplicating, this is the code:
If <touching paddle 1/2>, then:
Change score by (Score+1)
If <touching paddle 1/2>, then:
Change score by (Score+1)
- DrGaming_92Games
-
100+ posts
Score counter not working
I cant get my score to go up without going insanely rapid, or duplicating, this is the code:
If <touching paddle 1/2>, then:
Change score by (Score+1)
Please make your own topic rather than necroposting
- Discussion Forums
- » Help with Scripts
-
» Score counter not working