Perhaps you need to read through the principles section in the manual. To get an idea of the basics.
A simple way is simply to have a variable called score and increase it whenever the player is supposed to.
eg.
score=score+10
You can have a highscore variable and check that against the score and update if needed.
if score>hiscore
hiscore=score
endif
That's the basics you can obviously go further use an array and add a highscore table, which is a bit more complicated but basically the same thing just more data to check.