Discuss Scratch

inhabitants
Scratcher
14 posts

how to make a script only run once?

I have a script that reads as follows;

when spacekeypressedbroadcast startblockhide

I want this script only to run once, not to broadcast “start” everytime the space button is clicked. how do I do this?

Last edited by inhabitants (Dec. 17, 2019 14:01:59)

MeeYi
Scratcher
34 posts

how to make a script only run once?

stopthis script

Try this after that
inhabitants
Scratcher
14 posts

how to make a script only run once?

MeeYi wrote:

stopthis script

Try this after that
I already tried that, but it didnt work
MeeYi
Scratcher
34 posts

how to make a script only run once?

inhabitants wrote:

MeeYi wrote:

stopthis script

Try this after that
I already tried that, but it didnt work


Is it possible to

foreverstopthis script
inhabitants
Scratcher
14 posts

how to make a script only run once?

MeeYi wrote:

inhabitants wrote:

MeeYi wrote:

stopthis script

Try this after that
I already tried that, but it didnt work


Is it possible to

foreverstopthis script
nope, that didnt work either.
trucksarenoisy
Scratcher
100+ posts

how to make a script only run once?

For example when you click green flag set a variable to 1.
When you press space, it sets it to 0 and when you press it again it will not do it again.
Script:

whenclickedsetVariableto1

whenspacekeypressedifVariable=1thensayyour scriptsetVariableto0

Make sure you set the variable to zero after running it the script.

Last edited by trucksarenoisy (Dec. 17, 2019 14:29:45)

inhabitants
Scratcher
14 posts

how to make a script only run once?

you're a lifesaver! thank you!!
diparrisonfan
Scratcher
1 post

how to make a script only run once?

Thank you this also helped!!
whenclickedforeverifkeyspacepressed>thenticklemekeypressed?endend
happywaffle0
Scratcher
100+ posts

how to make a script only run once?

diparrisonfan wrote:

Thank you this also helped!!
whenclickedforeverifkeyspacepressed>thenticklemekeypressed?endend

thanks for knocking one person that needs help off the first page

seriously though, please do not necropost. this post was made almost 5 years ago and was already fixed.
Necroposting is when you reply to an inactive post for >2 weeks. It is necroposting when you give a solution that has no value. value is based off if the problem is about to be, or is, or hasn't been solved yet.

Powered by DjangoBB