Discuss Scratch

-folklore-1989-
Scratcher
2 posts

how to make a sprite appear at a random time in the project and only once

so I am making a project called 100 random questions! I have this thing that I want to appear at a random time during the project. it is two emojis and basically it says “shout-out emojis” which means that if you see and comment the two emojis you'll get a shout-out on my next project. and I don't know what code to use to make it so that the sprite will appear at a random time. after it appears I want it to stay there for like 1 second or 2 seconds and then hide. thanks

Last edited by -folklore-1989- (July 9, 2024 22:30:31)

-TUB-
Scratcher
100+ posts

how to make a sprite appear at a random time in the project and only once

You could try this script:

when green flag clicked
wait (pick random (5) to (240)) secs // these values can be adjusted
show
wait (2) secs
hide
-folklore-1989-
Scratcher
2 posts

how to make a sprite appear at a random time in the project and only once

Thank you!!
Woodfur
Scratcher
100+ posts

how to make a sprite appear at a random time in the project and only once

I'd suggest making it progress-based instead of just time-based, so the user won't miss it just because they went too fast.

when green flag clicked
wait until <(question #)= (pick random (1) to (100))>
wait (pick random (0.0) to (5)) secs //you can change this, but keep the decimal point to make it more random
show
wait (2) secs
hide

Powered by DjangoBB