Skip to content
Email jcinfo@juniorcoderz.com
Junior Coderz logo

Scratch

How to Use Cloud Variables in Scratch (Plus Variable Labels)

  • Junior Coderz Team
  • 6 min read
How to Use Cloud Variables in Scratch (Plus Variable Labels): Junior Coderz blog cover

Imagine a high score that everyone in the world can see and try to beat. That is what cloud variables in Scratch make possible. A normal variable resets for every player, but a cloud variable is saved on Scratch's servers and shared by everyone who plays your project.

This guide explains what cloud variables are, who can use them, how to make a global high score and a play counter, and how to make clear variable labels so players understand what they are looking at.

What Are Cloud Variables?

A variable is a box that stores a value, such as a score. Normally, each player gets their own copy, and it starts again every time the project loads. A cloud variable is different: its value is stored online, so every player sees the same number, and it stays saved after they leave. If one player in Pakistan sets a new high score, a player in Canada sees it straight away.

Normal variableCloud variable
Who sees the valueOnly the current playerEveryone who plays the project
Saved after the game closesNoYes
What it can storeNumbers and textNumbers only
Works offlineYesNo, only in shared online projects
Name on screenscore☁ score

How to Use Cloud Variables in Scratch

Before you start, check that your account can use them.

1. Check You Have Scratcher Status

New accounts start as "New Scratchers". Cloud variables are only available once your account becomes a "Scratcher", which happens automatically after you have been active for a while, sharing projects and joining in with the community. If you don't see the cloud option yet, keep creating and sharing, and check again later. Your profile page shows your status under your username.

2. Create a Cloud Variable

Go to the Variables category and click "Make a Variable". Type a name, such as "high score", and tick the box that says Cloud variable (stored on server). Click OK. The new variable appears with a small cloud symbol in front of its name.

Book a Free Trial Class

3. Share Your Project

Cloud variables only start working once the project is shared and played on the Scratch website. Remember that players need to be signed in to Scratch for their changes to be saved, so add a note on your project page asking them to log in. See our guide on how to share Scratch projects.

Project 1: Make a Global High Score

This is the most popular use of cloud variables. You need a normal variable called score and a cloud variable called ☁ high score. Add this script at the point where your game ends:

when I receive [game over]
if <(score) > (☁ high score)> then
    set [☁ high score] to (score)
    say [New world record!] for 2 seconds
else
    say (join [The record is ] (☁ high score)) for 2 seconds
end

Now every player can see the best score anyone has ever made, and try to beat it. This works perfectly with games like our Scratch snake game or Geometry Dash on Scratch tutorial.

Project 2: Count How Many Times Your Game Is Played

Make a cloud variable called ☁ plays and add this to the Stage:

when green flag clicked
change [☁ plays] by 1
say (join [This game has been played ] (join (☁ plays) [ times!])) for 2 seconds

Each time a signed-in player clicks the green flag, the number goes up for everyone.

Project 3: Make a Simple Poll

Ask a question like "Cats or dogs?" with two buttons. Make two cloud variables, ☁ cats and ☁ dogs. When a player clicks a button, change that variable by 1 and show both totals. It is a fun way to see what the Scratch community thinks.

How to Make Variable Labels in Scratch

When you tick a variable, it appears on the stage as a monitor, a small box showing its name and value. You can change how it looks so players understand it straight away.

Monitor styleWhat it showsHow to choose it
Normal readoutThe sprite name, variable name and valueRight-click the monitor on the stage
Large readoutOnly the value, in a big boxRight-click and choose "large readout"
SliderThe value with a slider to change itRight-click and choose "slider"

For a clearer label, try one of these tricks:

  • Rename the variable: right-click it in the Variables category and choose "Rename variable". A name like "Score" or "Lives left" is easier to read than "s".
  • Use a large readout plus a drawn label: choose "large readout", then paint a label such as "SCORE" on your backdrop next to it.
  • Make a custom label sprite: hide the monitor and use a sprite that says the value, for example say (join [Score: ] (score)) inside a forever loop.
  • Use "For this sprite only" carefully: these variables show the sprite's name in the monitor, so use "For all sprites" for a cleaner label.

New to variables? Start with our guide to using variables in Scratch.

Cloud Variable Rules and Limits

  • Numbers only: cloud variables can't store letters. Advanced Scratchers turn text into numbers with a code, but this is tricky for beginners.
  • A limited number per project: each project can only have a small number of cloud variables, so plan which ones you need.
  • Not for chat: the Scratch Community Guidelines don't allow using cloud variables to build chat rooms, to help keep everyone safe.
  • Remixes start again: when someone remixes your project, their cloud variables are separate from yours.
  • Be fair: make sure your high score code can't be cheated easily, for example by checking the score is realistic.

Fixing Common Problems

ProblemFix
No cloud option when making a variableYour account is still a New Scratcher; keep sharing and check later
The cloud value doesn't changeShare the project and play it on the website while signed in
It works for me but not for friendsFriends need to be signed in to Scratch
The variable won't store a nameCloud variables only store numbers
Nothing works in the offline editorCloud variables only work online; see our Scratch offline editor guide

Build Advanced Scratch Projects With Junior Coderz

At Junior Coderz, children learn Scratch in live online classes with engineer instructors, moving from the basics to advanced ideas like variables, lists, clones and online features. Our Scratch classes for kids build complete games step by step, and students ready for more can move on to Python and game development, where they learn how real online games store data. See every option on our courses page.

Ready to Take Scratch to the Next Level?

If your child already knows the basics, our engineer instructors can help them build bigger, smarter games. In a free trial class, they work on a live project, learn a new advanced skill and get honest advice on their next steps. There is no pressure and nothing to install.

  • Advanced Projects
  • Engineer Instructors
  • Ages 6 to 16

Book a Free Trial Class

Make a Game the Whole World Shares

Cloud variables turn a game you play alone into one the whole Scratch community plays together. Start with a global high score, add a play counter, then think of new ideas, like a world-wide poll. Share your project, ask players to sign in, and watch the numbers change. To see what other young coders are building, visit Junior Coderz or follow us on Instagram.

FAQs

Why can't I make a cloud variable in Scratch?

Your account is probably still a New Scratcher. Cloud variables become available once your account reaches Scratcher status.

Can cloud variables store text?

No. Cloud variables only store numbers. Advanced users convert letters into numbers with a code, but it is complex.

Do cloud variables work for everyone who plays?

Everyone can see the value, but players need to be signed in to Scratch for their changes to be saved.

How do I make a global high score in Scratch?

Make a cloud variable for the high score. When the game ends, check if the player's score is bigger, and if so, set the cloud variable to the new score.

How do I change how a variable looks on the stage?

Right-click the variable monitor on the stage and choose normal readout, large readout or slider. You can also rename the variable.

Do cloud variables work in the offline editor?

No. They only work in shared projects on the Scratch website.

Turn Screen Time Into Creation Time

Book a free trial class and see how your child learns to code with Junior Coderz.

Book a Free Trial Class
All articles