Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » How do i make a cloud var save system
- 1-o-v-e
-
Scratcher
100+ posts
How do i make a cloud var save system
When you create a variable, you can check “cloud variable” in the same screen where you rename them. There is, to my knowledge, no way to go back and change a variable that you have already made into a cloud variable (had it not been one to start with). Once a variable is a cloud variable, any changes made to the variable will automatically show up across computers. You can use this to set variables once a person's score is above the highest score, making that the new high score.
An important thing to note is that cloud variables can only store numbers, which means you cannot save usernames. There is a workaround, but I'm fairly certain the ST wouldn't be a giant fan of it if it gets used incorrectly (as in, don't use this trick to create an open, unmoderated chat, as these are banned on scratch). Anyways, in short, you can encode letters and symbols into numbers that get saved in the variable, then on the flip side, decode it back into letters that make up usernames. I discovered this technique from Griffpatch's youtube videos, I think he explained it in his Cloud Game Tutorial
Part 2
Hope this answers your question.
An important thing to note is that cloud variables can only store numbers, which means you cannot save usernames. There is a workaround, but I'm fairly certain the ST wouldn't be a giant fan of it if it gets used incorrectly (as in, don't use this trick to create an open, unmoderated chat, as these are banned on scratch). Anyways, in short, you can encode letters and symbols into numbers that get saved in the variable, then on the flip side, decode it back into letters that make up usernames. I discovered this technique from Griffpatch's youtube videos, I think he explained it in his Cloud Game Tutorial
Part 2
Hope this answers your question.

- Goner5
-
Scratcher
1000+ posts
How do i make a cloud var save system
Cloud variables only accept numbers to combat abuse of them.
You can use a simple ‘encoder’ and ‘decoder’ to encrypt data into numbers, and numbers back into usable data.
An example of this would be
The list ‘letters’ contains one letter in alphabetical order, each as a singular item. It includes dashes, spaces, punctuation.
You can use a simple ‘encoder’ and ‘decoder’ to encrypt data into numbers, and numbers back into usable data.
An example of this would be
define encode (string)
set [i v] to (0)
set [output v] to ()
repeat (length of (string))
change [i v] by (1)
set [output v] to (join (output) ((item # of (letter (i) of (string)) in [letters v]:: list) + (9))
end
define decode (string)
set [i v] to (1)
set [output v] to ()
repeat (length of (string))
set [output v] to (join (output) ((item (join (letter (i) of (string)) (letter ((i) + (1)) of (string))) in [letters v]:: list) - (9))
change [i v] by (2)
end
The list ‘letters’ contains one letter in alphabetical order, each as a singular item. It includes dashes, spaces, punctuation.
- tec123465
-
Scratcher
6 posts
How do i make a cloud var save system
For ranks and stats n stuffje moet wat meer scratch doen dan lukt dat wel.
- PcUserPro
-
Scratcher
500+ posts
How do i make a cloud var save system
Hello, so this topic has to be in Help with Scripts
- chuckieqqqqqq
-
Scratcher
0 posts
How do i make a cloud var save system
I can’t make the cloud variable switch on screen. It only saves in the cloud variable data.
- Discussion Forums
- » Questions about Scratch
-
» How do i make a cloud var save system