set (score) to (0) — Scratch Block Guide
Replaces the variable’s current value with a new number or string.
What this block does
Replaces the variable’s current value with a new number or string.
Reset score, lives, and game state at startup.
- Category: Variables & Lists
- Key tip: Never put "set score to 0" inside a forever loop, or your score will stay stuck at 0.
Working Scratch example
Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.
- When green flag clicked
- Set score to 0
- Set lives to 3
Try it: Guarantees every new game starts fresh with 0 score and 3 lives.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "set (score) to (0)" in Scratch?
Reset score, lives, and game state at startup. Never put "set score to 0" inside a forever loop, or your score will stay stuck at 0.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.