# How to Save a High Score in Scratch
Author: Arpita Jain
Author URL: https://www.codeyoung.com/blog/author/arpita-jain
Published: 2026-11-02
Category: Coding For Kids & Teens
Category URL: https://www.codeyoung.com/blog/category/coding-for-kids-and-teens
Meta Title: How to Save a High Score in Scratch
Meta Description: How to save a high score in Scratch with a cloud variable, what it will not store, and why the cloud box is missing from your child's New Variable dialog.
Tags: Game development, Scratch For Kids, Scratch Programming, Coding Lessons
Tag URLs: Game development (https://www.codeyoung.com/blog/tag/game-development), Scratch For Kids (https://www.codeyoung.com/blog/tag/scratch-for-kids), Scratch Programming (https://www.codeyoung.com/blog/tag/scratch-programming), Coding Lessons (https://www.codeyoung.com/blog/tag/coding-lessons)
URL: https://www.codeyoung.com/blog/scratch-save-high-score

Your child builds a game, adds a score counter, beats their own record, and closes the tab. The next day they open the project and the number is back to zero. Nothing is broken, and they did nothing wrong. Learning how to **save a high score in Scratch** means learning the one thing that separates a number held in a project from a number held on Scratch's servers, and most tutorials skip it entirely. For parents, this is a useful moment rather than a frustrating one: it is the first time a child meets the idea that some data lives on their computer and some lives somewhere else, which is the foundation of every app they will ever build after Scratch.

## What actually happens to a score when the page reloads?

The score was never saved anywhere that would survive. An ordinary Scratch variable is stored inside the project, and the value that loads when anybody opens that project is the value the project's owner last saved. A score your child reaches while playing lives in that browser session and nowhere else.

This is the part that trips up families, and it is worth being precise about, because the distinction is not obvious. If your child is the owner, has the project open in the editor, and saves it, the variable's current value is stored with the project. If your child is _playing_ a shared project, they cannot save it, because it is a project being viewed rather than edited. So their 4,820 goes nowhere.

The deeper reason is the one that matters. An ordinary variable is not shared between computers. Two children playing the same Scratch game are each running their own private copy of that number, and neither copy can reach the other. A high score that only one computer can see is not really a high score at all.

We cover the mechanics of building the score itself in our guide to [making a score counter in Scratch](https://www.codeyoung.com/blog/scratch-score-counter). This post is about the step after that one.

## What a cloud variable does differently

A cloud variable keeps its value on Scratch's servers rather than inside the project file. It is marked with a small cloud symbol in front of its name, and per the Scratch Wiki its value is **"truly global, and is reflected across all copies of the project being viewed on the Scratch Website"**. That single sentence is the whole feature.

![Three browser windows side by side showing the same Scratch game played by three different children, each with a different personal score of 120, 340 and 90, but all three showing an identical cloud high score of 4820](https://prod.superblogcdn.com/site_cuid_clvc4016q001j13bhaleswmt1/images/scratch-cloud-variable-shared-every-player-1793622554865-compressed.png)The personal score differs in every window. The cloud high score is one number shared by all of them, so when any player beats it, every other player sees it change.

Here is the consequence almost nobody warns children about, and it is the opposite of what they expect. **A cloud high score is not your child's high score. It is everybody's.** The moment a stranger plays the game and scores better, your child's personal best vanishes from the screen and is replaced by the stranger's. What a cloud variable gives you is a world record, not a personal record, and a nine-year-old who wanted to see their own best score will be upset by this rather than pleased.

That is not a reason to avoid it. A shared record is genuinely exciting when the project is being played by a class or a family, and it is the correct tool for a leaderboard. It is simply a different thing from what the phrase "save my high score" sounds like it means.

## Why is the cloud option greyed out?

Because the account is still a New Scratcher. This single fact accounts for most of the frustration around cloud variables, and no tutorial mentions it, because the person writing the tutorial passed that threshold years ago.

![Scratch New Variable dialog drawn with the For all sprites and For this sprite only options available in dark text while the Cloud variable checkbox below is greyed out with a padlock icon, above a checklist of the four requirements needed to enable it](https://prod.superblogcdn.com/site_cuid_clvc4016q001j13bhaleswmt1/images/scratch-new-variable-cloud-option-greyed-out-1793622622857-compressed.png)The two scope options are available and the cloud checkbox is not. A child who has had an account for three days will see this and assume they have made a mistake.

Scratch states plainly that cloud data cannot be used by New Scratchers. Promotion to Scratcher is automatic, and the Scratch Wiki lists what generally gets an account there:

- a verified email address
- at least two shared projects
- helpful comments on other people's projects
- roughly two weeks on the site, with real activity

Two details are worth knowing before your child starts counting days. **The exact requirements are deliberately not published**, so nobody can tell you precisely when it will happen. And the Scratch Team will not promote an account on request, so writing to ask does not help. The honest advice to a child in week one is to build and share two projects, comment kindly on a few others, and come back to the cloud idea in a fortnight.

One more constraint catches children working on a downloaded copy of Scratch: because cloud data is stored on the server, **cloud variables cannot be used in the offline editor at all**. If your child codes in the desktop app, a cloud high score cannot be tested there. It has to be done in the browser, signed in.

Not sure which level your child should start at? A free trial class with a Codeyoung
teacher shows you exactly where they are and what they are ready for next, before you
commit to anything.

[Book a Free Trial →](https://book-a-demo.codeyoung.com?utm_source=blog&utm_medium=codeyoung&utm_campaign=scratch-save-high-score)

## What a cloud variable will not store

Numbers, and only numbers. The Scratch Wiki is blunt about it: cloud variables **"can contain only numbers (unlike regular variables, they can't contain letters or symbols)"**, with a character limit of 256 digits per variable.

![Four rows testing which values a Scratch cloud variable accepts: the number 4820 is ticked and accepted, while ZARA is refused for letters, A plus is refused for symbols and a 257-digit number is refused for being too long](https://prod.superblogcdn.com/site_cuid_clvc4016q001j13bhaleswmt1/images/scratch-cloud-variable-accepted-refused-values-1793622563703-compressed.png)Exactly one of these four stores successfully. The refusal of letters is why a names-and-scores leaderboard is a much bigger project than it looks.

Think about what that rules out. The leaderboard your child has pictured, a tidy top-five list with names beside the scores, **cannot be built with cloud variables alone**, because a name is letters. Projects that manage it encode each letter as a number, store one long numeric string, and decode it again on load. That is a genuinely advanced technique and it is well beyond a first Scratch game. If a tutorial promises a named leaderboard in ten minutes, it is either using a different mechanism or it is not telling you the whole thing.

Three further limits are worth writing on a sticky note:

LimitValueWhy it mattersContentNumbers only, up to 256 digitsNo names, no letters, no symbolsCloud variables per project10Enough for a few records, not for per-player dataUpdate rate10 times per second maximumA forever loop runs much faster and will be throttled

## The working script, step by step

Four steps. Each one has a result your child can check before moving on, which is the only reliable way to debug a Scratch project.

1. **Make the ordinary score variable first.** Click Make a Variable, name it `score`, and choose "For all sprites". Result: `score` appears in the Variables palette and on the stage.
2. **Make the cloud variable.** Click Make a Variable again, name it `high score`, and tick the cloud box. Result: it appears with a small cloud in front of its name. If the box is greyed out, see the section above.
3. **Set the ordinary score to 0 at the green flag. Never the cloud one.** Put `set score to 0` under `when green flag clicked`. Leave `high score` out of that stack entirely. Result: starting the game zeroes the current score and leaves the record alone.
4. **Compare once, at the end of the game.** Where the game finishes, add `if score > high score then set high score to score`. Result: the record only moves when it is beaten, and the cloud variable is written once per game rather than continuously.

Step 3 is the one children get wrong, and the mistake is invisible until it is catastrophic: putting the cloud variable in the green-flag stack wipes the shared record for everyone, every time anybody presses the flag.

## Three ways this breaks

The first is the **forever loop**. A cloud variable accepts at most ten updates per second, and a Scratch forever loop runs roughly thirty times a second, as we found while building the [lives counter and game over screen](https://www.codeyoung.com/blog/scratch-lives-counter-game-over). A cloud set block inside a bare forever loop is therefore asking for about three times the permitted rate, and the updates will not all land. Write to the cloud when something happens, not on every frame.

The second is **resetting the record**, covered in step 3. Watch for it in two places: the green-flag stack, and any "restart" or "play again" script your child adds later.

The third is **testing alone and concluding it works**. A single player cannot see the global behaviour of a cloud variable, because there is nothing to compare against. The test that proves it is two devices: open the shared project on a laptop and a tablet, beat the score on one, and watch the number change on the other. If your child has never seen that happen, they have not really seen what a cloud variable is.

## What if you want a personal best instead?

Be honest with your child here, because the honest answer is useful. Scratch has no simple per-player storage. There is no built-in way to say "remember this number for this one child and nobody else".

Two reasonable options exist. For a personal best within a single play session, an ordinary variable is perfect and needs no cloud at all: it holds the best score of the afternoon, which is usually what a younger child actually wants. For a record that genuinely persists, the cloud variable is the tool, with the understanding that it belongs to everyone who plays.

A child who finds this limitation annoying has arrived somewhere important. Wanting per-user data that survives a reload is wanting a database and user accounts, and that is the honest reason programmers move from Scratch to text languages. If your child is pushing at that boundary, our guide on whether they are [ready to leave Scratch](https://www.codeyoung.com/blog/ready-to-leave-scratch) is the right next read, and our [Scratch classes](https://www.codeyoung.com/coding/scratch-coding-classes-for-kids?utm_source=blog&utm_medium=codeyoung&utm_campaign=scratch-save-high-score) cover cloud variables with a teacher who can test the two-device case with them live.

## Conclusion

A high score needs somewhere to live that is not the project file, and on Scratch that place is a cloud variable. It stores numbers only, up to 256 digits, ten per project, at no more than ten updates a second, and it cannot be used at all by a brand-new account or in the offline app. Most importantly, the number it holds is shared by every single person who plays the game, so what your child is building is a world record rather than a private one. Set the ordinary score at the green flag, compare once when the game ends, and test it on two devices before believing it works.

Codeyoung runs 1:1 live online classes for children aged 6 to 17, with a teacher who
adapts the pace to your child rather than a fixed syllabus. The first class is free, so
you can see how they respond before deciding.

[Book a Free Trial](https://book-a-demo.codeyoung.com?utm_source=blog&utm_medium=codeyoung&utm_campaign=scratch-save-high-score)

Cloud variable limits and New Scratcher requirements checked against the [Scratch Wiki cloud variable reference](https://en.scratch-wiki.info/wiki/Cloud_Variable) and the [Scratch Wiki New Scratcher page](https://en.scratch-wiki.info/wiki/New_Scratcher), both checked 2 November 2026.
## FAQs
Q: Why does my child's high score disappear when they reload the game?
A: An ordinary Scratch variable is not shared between computers. The number that loads when anyone opens the project is the one stored inside the project itself, so a score reached by a player sits in that browser session only. Reloading starts again from the stored value.

Q: What is a cloud variable in Scratch?
A: A cloud variable is a variable whose value is kept on Scratch's servers instead of inside the project file. The Scratch Wiki describes the value as truly global and reflected across all copies of the project being viewed on the website, so every player sees the same number.

Q: Why is the cloud variable option greyed out?
A: Because the account is still a New Scratcher. Cloud data cannot be used by New Scratchers. Promotion is automatic and generally needs a verified email, at least two shared projects, helpful comments and about two weeks of activity. The exact requirements are not published and the Scratch Team will not promote an account on request.

Q: Can a cloud variable store a player's name for a leaderboard?
A: No. Cloud variables can contain only numbers, not letters or symbols, with a limit of 256 digits per variable. A leaderboard showing names needs the letters encoded as numbers first, which is a much harder project than most tutorials suggest.

Q: Do cloud variables work in the offline Scratch app?
A: No. Cloud data is stored on Scratch's server, so cloud variables cannot be used in the offline editor. A child working in the downloaded app will not be able to test a cloud high score at all, which is a common source of confusion.

Q: How often can a cloud variable be updated?
A: At most ten times per second. That matters because a forever loop runs far faster than that, so a cloud set block placed directly inside a forever loop will be throttled. Update the cloud variable once, when the game ends, rather than continuously.




---
This blog is powered by Superblog. Visit https://superblog.ai to know more.
---

