Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Can Scratch lock online variables when refreshing?
- heavenlydeity
-
Scratcher
3 posts
Can Scratch lock online variables when refreshing?
In my game, I have a blue circle that should add one to an online variable when clicked. It should also remember the last number it was when I refresh the page. But there's a problem: after refreshing and restarting the game, the variable always goes back to the original number. I haven't used any ‘set’ blocks for my variable. I've checked the cloud variables (those are the ones under the thumbs-up and heart icons), and I think the number is saved there but not shown on the variable itself. I've also tried using an online variable on multiple devices, but when a new device joins, it always resets the number. Can anyone help me figure out why this isn't working? The game link is below. It's a very simple example of this issue. https://scratch.mit.edu/projects/1079925546/
- awesome-llama
-
Scratcher
1000+ posts
Can Scratch lock online variables when refreshing?
They are supposed to save but have a tendency to break. Potential causes include downloading/uploading the project, backpacking scripts, remixing, or things outside of your control such as changes to Scratch or its servers.
You can fix them either by renaming them or deleting/recreating them.
You can fix them either by renaming them or deleting/recreating them.
- RokCoder
-
Scratcher
1000+ posts
Can Scratch lock online variables when refreshing?
They are supposed to save but have a tendency to break. Potential causes include downloading/uploading the project, backpacking scripts, remixing, or things outside of your control such as changes to Scratch or its servers.This should be the default answer for any question about cloud variables not working
You can fix them either by renaming them or deleting/recreating them.

- heavenlydeity
-
Scratcher
3 posts
Can Scratch lock online variables when refreshing?
Thank you for the feedback on my issue on online variables not locking.
- MillionOfficial
-
Scratcher
500+ posts
Can Scratch lock online variables when refreshing?
View source
- Cloud variables are reset whenever the server restarts or when no one is in the project for a short period of time, so things like leaderboards won't be saved very long.
Last edited by MillionOfficial (Oct. 12, 2024 22:39:47)
- awesome-llama
-
Scratcher
1000+ posts
Can Scratch lock online variables when refreshing?
View source
- Cloud variables are reset whenever the server restarts or when no one is in the project for a short period of time, so things like leaderboards won't be saved very long.
TurboWarp has its own cloud variable server independent of Scratch.Turbowarp's cloud variables are not like Scratch's.
- Discussion Forums
- » Help with Scripts
-
» Can Scratch lock online variables when refreshing?