Discuss Scratch
- Discussion Forums
 - » Help with Scripts
 - » How do i add a high score feature?
        
         
- royalmichaelg
 - 
                            
						
						
                            Scratcher
                        
						
						 
21 posts
How do i add a high score feature?
when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
- Mr_Woomy
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
How do i add a high score feature?
How do i make it when the high score IS set it keeps the person who got the last ones name?when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
- cool_coder63
 - 
                            
						
						
                            Scratcher
                        
						
						 
20 posts
How do i add a high score feature?
that would need a decoder because cloud variables don't hold text only numbers (edit: nvm I read it wrong and I don't understand)How do i make it when the high score IS set it keeps the person who got the last ones name?when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
Last edited by cool_coder63 (Aug. 19, 2021 00:14:42)
- Thingied
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
How do i add a high score feature?
How do i make it when the high score IS set it keeps the person who got the last ones name?You'll have to encode it to a cloud variable and decode it when you want to show it.
- tueminh2013
 - 
                            
						
						
                            Scratcher
                        
						
						 
17 posts
How do i add a high score feature?
Script:How do i make it when the high score IS set it keeps the person who got the last ones name?when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
Add code
set [☁Username record v] to (username)on if
Last edited by tueminh2013 (Aug. 19, 2021 07:52:41)
- deck26
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
How do i add a high score feature?
Don't set a cloud variable in a forever loop if that might mean it updating more than once per 0.1 seconds.
To store a username and high score you need to encode the username and store that to the cloud as well. You can easily combine a score and a username in a singel cloud variable.
The wiki page on Global High Scores is a good reference.
                        
                        
                    To store a username and high score you need to encode the username and store that to the cloud as well. You can easily combine a score and a username in a singel cloud variable.
The wiki page on Global High Scores is a good reference.
- vineet_wibyte
 - 
                            
						
						
                            Scratcher
                        
						
						 
28 posts
How do i add a high score feature?
As mentioned above, this is done with a cloud variable. I agree, however, that is not a great idea to keep the update of a cloud variable inside forever, unless absolutely necessary. Better is to use a broadcast towards the end of the game and update once. Please take a look at https://youtu.be/YCkXqyIpFp4 and the links from the description to learn more about cloud variables and their usage for high score etc, Take care, cheers! 
                        
                        
                    - swordslasher_1290
 - 
                            
						
						
                            Scratcher
                        
						
						 
48 posts
How do i add a high score feature?
when I receive [next level v]
set [highscore v] to [score]
- mrcreatorluigi
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
How do i add a high score feature?
Script:That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
Add codeset [☁Username record v] to (username)on if
- orangetheory
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
How do i add a high score feature?
when I receive [next level v]
set [highscore v] to [score]
Please don't necropost or spam
Wouldn't work as cloud variables can't contain letters or symbols to prevent online chatting and other safety reasonsScript:How do i make it when the high score IS set it keeps the person who got the last ones name?when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
Add codeset [☁Username record v] to (username)on if
- Earthbright
 - 
                            
						
						
                            Scratcher
                        
						
						 
97 posts
How do i add a high score feature?
How can I make a battle Royale game with scrolling maps that can be selected at the start?
                        
                        
                    - Mr_Woomy
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
How do i add a high score feature?
How can I make a battle Royale game with scrolling maps that can be selected at the start?Bro why are you here to ask that?
This is a post for something different
- yitenggenius
 - 
                            
						
						
                            Scratcher
                        
						
						 
37 posts
How do i add a high score feature?
on scratch you cant use letters in cloud variablesScript:How do i make it when the high score IS set it keeps the person who got the last ones name?when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
Add codeset [☁Username record v] to (username)on if
- NetherRobot01
 - 
                            
						
						
                            Scratcher
                        
						
						 
14 posts
How do i add a high score feature?
You can, it's just going into crazy topics such as encrypting and decrypting.Script:That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
Add codeset [☁Username record v] to (username)on if
- NetherRobot01
 - 
                            
						
						
                            Scratcher
                        
						
						 
14 posts
How do i add a high score feature?
Or something even more advanced such as shifting.You can, it's just going into crazy topics such as encrypting and decrypting.Script:That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
Add codeset [☁Username record v] to (username)on if
- JaxTheWarrior83
 - 
                            
						
						
                            Scratcher
                        
						
						 
20 posts
How do i add a high score feature?
when green flag clicked
forever
if <(foo) > (☁ score)> then
set [(☁ score) v] to [score]
set [HScoreName v] to (username)
end
end
Last edited by JaxTheWarrior83 (Aug. 30, 2021 15:09:40)
- Thingied
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
How do i add a high score feature?
set [HScoreName v] to (username)
That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
- Discussion Forums
 - » Help with Scripts
 - 
            » How do i add a high score feature? 
         
            












