How to Make a World Record Counter or Variable in Scratch
A world record counter in Scratch is a variable that holds a saved score or number, so the highest value reached stays on screen from one play to the next. You create a variable such as record, update it when the current score passes the stored value, and display it on the stage with a label so players can see how a new score compares. A cloud variable is the option that keeps a record across users and sessions, while a plain variable keeps it in one project run.
Creating the record variable
Scratch variables store a single value that scripts can read and change, and a record counter is just one of them. Open the Variables category, choose Make a Variable, and give it a clear name such as record so the label on the stage reads well. Keep score and record as two separate Scratch variables, because score tracks the current attempt and record holds the saved value. This split lets one script change the score while another only raises the record when the score is higher.
Updating the record with conditions
A record counter only moves in one direction, so the script must compare two values before it saves anything. Use an if block with the condition score greater than record, and place set record to score inside it. During play, the Scratch counter checks this condition each time the score changes rather than only at the end of the game. That test keeps the record equal to the highest score reached so far in the session.
When to use a cloud variable
A cloud variable is a special Scratch variable whose value is stored on the Scratch servers instead of only in the open project. Mark the record variable as a cloud variable when the number should persist between sessions and be readable by other players. Cloud variables suit number values such as a high score, and Scratch restricts them to digits so the stored data stays simple. Treat the cloud record as shared data and test updates carefully, since any script that writes to it changes the value everyone sees.
Questions about Scratch record counters
How do I make a world record counter in Scratch?
A world record counter in Scratch is made from a variable plus a comparison script. Create a variable named record, then have your game check whether the score is greater than record and set record to the score when it is. Display the variable on the stage so the saved value stays visible.
What is the difference between a normal record variable and a cloud variable?
A normal record variable lives only inside one run of the project, so it resets when the project restarts. A cloud variable stores its value on the Scratch servers, which lets the record survive between sessions and be shared with other players. Cloud variables accept numbers only, which fits a score counter well.
How do I keep the record from going down again?
A Scratch record stays safe when the script writes to it only through a greater-than comparison. Test whether the score is higher than record, and change record only inside that condition. Never place set record to score in a block that runs on every score change without the test.
Can I show the record on the stage while the game runs?
A Scratch variable shows on the stage once you tick its checkbox in the Variables category. The record appears in a monitor that updates as the value changes, and you can drag the monitor to a clear spot. Rename the variable to something readable so the monitor label makes sense to players.
Read next
-
Record storage ideas for small spaces
-
Terraria Player Stats
-
Pawn shops buying records
-
How wide is an LP record and vinyl album
-
How to build record storage
-
How long medical records are kept
-
How to turn on and hook up a record player
-
Tokyo record store merchandise
-
How to make a wall hanging at home for Diwali
-
How to make vinyl records shine