Help using functions from Rob's score module

I have found this tutorial:

https://coronalabs.com/blog/2013/12/10/tutorial-howtosavescores/#comment-643947

For helping me to display and save scores, I found it very useful, but I have a question:

How can I get the current value of the score? I tried using local myscore = score.get() and tried to print it, but it only printed a zero, when my score was 160. 

I use:

local points = 0

To count my points, I tried points.get(), and that did not work either, how can I display and save the high score using that score module, I don’t want to try json or mysql.

Thank you in advance.

Sincerely,

Alex

I need to use score.get() to get the current score, compare it with the previous highscore to see if it is higher or lower, to determine whether or not it is the new highscore.

You can save it as txt file
https://docs.coronalabs.com/guide/data/readWriteFiles/index.html

if currentScore > score.get() then
score.set(currentScore)
end

I have saved it as a txt file:

highestPointsText = score.init({ fontSize = 40, font = "Helvetica", x = \_R - 170, y = \_T + 100, maxDigits = 5, leadingZeros = false, filename = "scorefile.txt", })

score.get() is not getting the correct value, I am not sure what it is getting, but it is not correct.

This was working in game, but after I restarted the game the value went back to 0.

Thank you scottrules44, your code helped me get started and everything works!

I need to use score.get() to get the current score, compare it with the previous highscore to see if it is higher or lower, to determine whether or not it is the new highscore.

You can save it as txt file
https://docs.coronalabs.com/guide/data/readWriteFiles/index.html

if currentScore > score.get() then
score.set(currentScore)
end

I have saved it as a txt file:

highestPointsText = score.init({ fontSize = 40, font = "Helvetica", x = \_R - 170, y = \_T + 100, maxDigits = 5, leadingZeros = false, filename = "scorefile.txt", })

score.get() is not getting the correct value, I am not sure what it is getting, but it is not correct.

This was working in game, but after I restarted the game the value went back to 0.

Thank you scottrules44, your code helped me get started and everything works!