To make this part of your code everything that is needed is in the Message Sprite. Copy it to your backpack and drag it into your code calling the relevant broadcasts it provides. Position the Sprite where you want your Highscore to be displayed. Note it clears the screen before display! So any stamped images will disappear each time it is drawn. (Though I could create a box background as an alternative if needed) It uses the variable SCORE (in caps) to store the current player score To change the size of the writing modify the SIZE in the green flagged portion of the message sprite. If you use this code please give credit and a link so that others can too. IMPORTANT: Seems when cloud variables are copied via a sprite they do not necessarily become global cloud variables in the new project even though they still claim to be cloud variables. However they do not seem to function quite right. You may need to delete the 10 cloud variables and recreate them to get it to work right.
v1,2 Had to set all user blocks to without screen refresh else data corruption was occurring. v1.1 Had to do a few fixes as it was clearing the data all the time now there is a separate eraseAllHighScores broadcast for resetting them. The Message sprite contains all the variables and code needed to maintain and display a high score table with 5 entries. The names are encoded to numbers using an algorithm as currently cloud data only stores numbers and because of this has a limit of 10 characters. The encoding works on the principal that each letter (if in caps) can only be one of 39 symbols. So it uses a loop to analyse each letter and multiplies its costume# by the appropriate power of 39. Combining them all into s single number.