Codingal > Coding for kids > Blogs > How do cloud variables work on scratch?

How do cloud variables work on scratch?

Aleena Martin on August 20, 2025

Introduction

Imagine you’ve built a rocking game on Scratch where players can play as well as collect points, and you want to save these points so that everyone around the world can see the high scores. This is where cloud variables come into the picture!

Cloud variables in Scratch are a special type of variable that stores various data online in turn allowing it to be shared and updated by multiple users in real time experience. They’re like the magic storage spaces in the cloud that let your game or project keep track of information across different devices and users.

In this guide, we’ll explore how cloud variables work in Block-Based Coding as well as how to use them and some fun ideas for what you can do with them!

 

What Are Variables in Scratch?

Before diving into cloud variables, let’s quickly understand what a variable in Scratch is. A variable is like that of a container which holds information. In Scratch, you can create variables to store things like:

– A player’s score in a game.

– The number of lives a character has.

– The number of items collected by a player.

 

You can name the variable by your choice  and update it as your game progresses. For example, say you have a “score” variable, it will increase each time a player earns points. These variables only work on the computer where the game is being played. But what if you want to share this exact data with everyone? That’s where cloud variables come in!

 

What Are Cloud Variables?

 

A cloud variable is a special kind of variable that stores information online in the Scratch “cloud.” This means that the data is saved and can also be shared across different users and computers. For example, if you use the cloud variable to store the high scores in your games, all players can see the latest high score even if they’re playing from various different places.

 

Some key features of cloud variables:

  1. – Shared Data: Data stored in cloud variables is visible and available to anyone who plays your Scratch project.

  2. – Real-Time Updates: If a player updates the score in the game using cloud variables, other players will automatically see the updated score.

  3. – Permanent Storage: The data is saved even after the project is closed, hence you don’t have to worry about ever losing it.

 

How to Use Cloud Variables

 

Using cloud variables in Scratch is very easy peasy. Here’s a step-by-step tutorial on how to add and utilise the cloud variables in your Scratch projects:

1. Sign In to Scratch

You must be logged in on your Scratch account to use cloud variables. If you’re not signed in, then the option to create cloud variables won’t be visible.

 

2. Create a Cloud Variable

After successfully signing in, we now move on to our ultimate objective which is creating a cloud variable. Here’s how you create your cloud variable:

 

– Look up for the “Variables” section of Scratch, click on the very option “Make a Variable.”

– A small window would pop up asking for the name of your new variable. At the bottom of this window you’ll see a checkbox labelled “Cloud variable (which is stored on server).” Open and check this box before clicking “OK.”

– And that’s it! You’ve now successfully  created a cloud variable.

 

3. Use the Cloud Variable in Your Project

Now that your cloud variable is ready, you can use it on your Scratch project just like a normal variable. For example,

– To track the high scores: You can use the blocks of “set” and “change” to update the cloud variable whenever a player reaches a new high score.

– To display data to users: Use the block “show variable” to make the cloud variable visible during the game so players can see the latest scores.

 

Also, each of the Scratch projects can have a maximum of exactly ten cloud variables, so use them wisely.

 

Benefits of Cloud Variables

 

Cloud variables open up to very exciting possibilities for your Scratch projects. Here are some fun ideas on how to use them:

1. High scores and leaderboards:

Cloud variables are perfect for creating high score leaderboards. Every time a player finishes the game, you can update the leaderboard with their score. This allows players worldwide to compete for the highest score which makes it even more challenging!

 

2. Multiplayer games

With cloud variables you can make simple online multiplayer games. For example, you can use cloud variables to track the very position of different players or the score in real-time which in turn allows players to compete against each other even from different locations.

 

3. Create survey polls

Want to collect different feedback and opinions from people who play your Scratch project? Use cloud variables to create a simple survey or poll. As users submit their answers, the results will be stored and updated in the cloud hence, letting everyone see the live results or feedback.

 

4. Collaborative projects: 

You can build projects where users and players work together. For example, a project where users play with a shared story or artwork. Each and every new addition is saved with cloud variables. Hence, creating a collaborative final product.

 

Conclusion

 

Cloud variables are an amazing tool in Scratch that allow your projects to interact with players worldwide. By storing data online you can create more dynamic, interactive, and competitive experiences for everyone such as leaderboards, multiplayer games, and globalised events. As you explore the possibilities of cloud variables, you’ll find endless possibilities to make your Scratch projects more exciting and engaging. 

So why not just give it a try and create a project that connects the world? Jump right on to kids’ coding classes, where kids and teens learn to adapt to the digital world of coding through simple and fun learning experiences! 

Encourage learning everywhere you go and have fun with your coding journey! At Codingal, we’re here to support you every step of the way. Happy coding!

Share with your friends

Try a free class