Discuss Scratch

GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

something like this
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

add (join (username) (join [:] (☁ score))) to [list v]
WafflesYouTubeMC
Scratcher
500+ posts

how do you make a high score list

you would have to encode the usernames into a string of only numbers and then decode them once loading the list. (because cloud variables can only be numbers -'s or .'s, not letters)
MrSpace-fish
Scratcher
53 posts

how do you make a high score list

You might have to get creative encoding the data since Scratch has a 255 char limit on Cloud variables.

Last edited by MrSpace-fish (Nov. 4, 2025 21:37:54)

GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

dem_bot
Scratcher
100+ posts

how do you make a high score list

First you make a nice little list, containing every char a user can have in their name, including numbers and a special separator char ( ̝ can work). You can then use the item number + 9 to represent one digit (I assume you need less then 91 chars). Then for each char in the username you add the item num + 9 of the letter in the list. After that, you stick on the item number of the separator and then the score.

To decode, you pick sets of two chars, join them and do them - 9 and then see which item in the char list corresponds to that. When it comes across the separator, it can stop decoding and just take the rest as a plain number.
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

when green flag clicked
add [a] to [list v]
add [b] to [list v]
add [c] to [list v]
add [d] to [list v]
add [e] to [list v]
add [f] to [list v]
add [g] to [list v]
add [h] to [list v]
add [i] to [list v]
add [j] to [list v]
add [k] to [list v]
add [l] to [list v]
add [m] to [list v]
add [n] to [list v]
add [o] to [list v]
add [p] to [list v]
add [q] to [list v]
add [r] to [list v]
add [s] to [list v]
add [t] to [list v]
add [u] to [list v]
add [v] to [list v]
add [w] to [list v]
add [z] to [list v]
add [y] to [list v]
add [z] to [list v]
add [1] to [list v]
add [2] to [list v]
add [3] to [list v]
add [4] to [list v]
add [5] to [list v]
add [6] to [list v]
add [7] to [list v]
add [8] to [list v]
add [9] to [list v]
add [0] to [list v]
add [_] to [list v]
add [-] to [list v]
add [.] to [list v]
like this?
bsteichman
Scratcher
500+ posts

how do you make a high score list

cloud variables only store numbers. So you have to convert letters into numbers:
a -> 01
b -> 02
z -> 26
1 -> 27
% -> 52
etc…
and a separator to split the text along, I like to use an uncommon character like “§”

so then your text looks like: username§score§username§score§username§score

and then convert into numbers
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

bsteichman wrote:

cloud variables only store numbers. So you have to convert letters into numbers:
a -> 01
b -> 02
z -> 26
1 -> 27
% -> 52
etc…
and a separator to split the text along, I like to use an uncommon character like “§”

so then your text looks like: username§score§username§score§username§score

and then convert into numbers
that's not exactly the only problem https://scratch.mit.edu/projects/1236019265/editor/

Last edited by GAGETHEDUDE (Nov. 5, 2025 16:00:35)

WafflesYouTubeMC
Scratcher
500+ posts

how do you make a high score list

yes, then you just need to assign a number to each one based on its position in the list and encode the usernames with dashes so in your example, if someones username was “waffles1” then you would encode it as “23-01-06-06-12-05-19-27” maybe add a “.14” at the end (14 being the score). then you would decode it with the same thing and put it on a leaderboard list

above wouldn't work because that special character cannot be in cloud variables, they can only contain “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “0”, “.”,
and “-”

Last edited by WafflesYouTubeMC (Nov. 5, 2025 16:43:04)

pancakeken
Scratcher
57 posts

how do you make a high score list

mabye you could do,
when green flag clicked
forever
if [☁ score] > [previous score] then
insert [username] at (1) of [list]
end
pancakeken
Scratcher
57 posts

how do you make a high score list

I swear this ain't gonna work but you can try it.
WafflesYouTubeMC
Scratcher
500+ posts

how do you make a high score list

pancakeken wrote:

I swear this ain't gonna work but you can try it.
it wouldn't make a cloud leaderboard, its not even close to working lol. you need to add the usernames to the cloud variable and without them supporting letters, you have to encode so yea its a lot more than just that
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

so say
add [a] to [list v]
define [encode] [ ]
when green flag clicked
forever
if then

end
end
and I don't know what to do after that
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

set [encode name] to [(username)]
define encode
GAGETHEDUDE
Scratcher
35 posts

how do you make a high score list

WafflesYouTubeMC
Scratcher
500+ posts

how do you make a high score list

quite inefficient but it kinda works lol

Powered by DjangoBB