Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Save codes
- Izzy989
-
7 posts
Save codes
I just can't figure out how to make a save code no matter how hard I try! Can somebody please explain it to me then give me an example?
- Non-Generic_Cube
-
6 posts
Save codes
Well, I don't think I can explain it, but I made a save code using a tutorial. Just search up ‘save code tutorial ’ on Scratch, hope that will help! 
Also, if you wanna make more complex save codes that are harder to cheat on, search up ‘encoding and decoding’

Also, if you wanna make more complex save codes that are harder to cheat on, search up ‘encoding and decoding’
Last edited by Non-Generic_Cube (Sept. 23, 2024 17:17:37)
- bombardingppl
-
500+ posts
Save codes
A lot of save codes are when you join all of the data sets into a single string and be able to decode it into data again when they load the code. Here's an example.
Clicker game
clicks: 100
clicks per second: 5
The save code would look something like “100 5” or maybe “100|5”. You usually want to avoid the one with the spaces, because some data values might include spaces, let's say something like, “diamond clicker”, and the save code might look like “100 5 diamond clicker”. Now this is a problem because when you decode the code, it might think that there are 4 values instead of three, thinking that the “diamond” and “clicker” are different. So it's a good idea to use a separator that will never appear in your data.
Now let's use the “|” to separate our data. This is what our code might look like
decoding is very difficult and if you'd like I'll show you how that is done if you let me know. For now, this is a way of encoding data.
Clicker game
clicks: 100
clicks per second: 5
The save code would look something like “100 5” or maybe “100|5”. You usually want to avoid the one with the spaces, because some data values might include spaces, let's say something like, “diamond clicker”, and the save code might look like “100 5 diamond clicker”. Now this is a problem because when you decode the code, it might think that there are 4 values instead of three, thinking that the “diamond” and “clicker” are different. So it's a good idea to use a separator that will never appear in your data.
Now let's use the “|” to separate our data. This is what our code might look like
decoding is very difficult and if you'd like I'll show you how that is done if you let me know. For now, this is a way of encoding data.
- bsteichman
-
500+ posts
Save codes
well first you take any variables that you would need EX) health, playerX, playerY, number of consumables left and simply join them:
then give them the code:
then to use this save code, do something like:
- Discussion Forums
- » Help with Scripts
-
» Save codes