Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Hit Button Multiple Times
- berylliumbanana
- Scratcher
5 posts
Hit Button Multiple Times
I'm a total newbie at scripts, and I was very frustrated with my latest project.
How do you have it so if you hit a button multiple times to have something happen? Like “hit the up arrow 10 times.”
I would like to know as soon as possible.
How do you have it so if you hit a button multiple times to have something happen? Like “hit the up arrow 10 times.”
I would like to know as soon as possible.
- dracae
- Scratcher
1000+ posts
Hit Button Multiple Times
Here's an example:
So, whenever you press space, it waits till you release, then it changes the variable “TimesPressed” by 1.
Once it reaches 10, the next (if then) activates.
If you want it to reset, just join a (set TimesPressed to 0), like the one at the start of the script.
Hope I helped!
So, whenever you press space, it waits till you release, then it changes the variable “TimesPressed” by 1.
Once it reaches 10, the next (if then) activates.
If you want it to reset, just join a (set TimesPressed to 0), like the one at the start of the script.
Hope I helped!
Last edited by dracae (June 12, 2013 00:56:10)
- berylliumbanana
- Scratcher
5 posts
Hit Button Multiple Times
Ah, okay! Thank you so much. I really need to learn the basics of coding before I start going off on specific projects…Haha.
- Discussion Forums
- » Help with Scripts
- » Hit Button Multiple Times