High score?

My goal is to make my game so that it will show the highest score scored until they get a higher score at the top of the screen. I have the positions, but I am wondering what code to put under my event. So far, I have this –

highscore = highscore + 0
highscorescore.text = highscore

the high score is globally set to zero, but i am wondering what to put where the “0” is. Obviously, a zero is not susceptible to change.
I’m thinking its something along the lines of

highscore largestscore

or something but I don’t know that actual code [import]uid: 39628 topic_id: 7745 reply_id: 307745[/import]

Do you mean you want to save the score to .text if it’s a new highscore? Just do:

[code]

if(score > highscore) then
highscore = score
highscore.text = highscore
end

[/code] [import]uid: 14018 topic_id: 7745 reply_id: 27472[/import]

thanks nahir it worked! really appreciated :slight_smile: [import]uid: 39628 topic_id: 7745 reply_id: 27491[/import]