I'm completely new to all of this, but somehow I've managed to almost finish my platformer trivia game. All I need to finish is the leaderboard. After researching, I decided that the best method for our needs was to save scores in an array and use the local storage plug in. But for the life of me, I cannot get it to save multiple scores. Right now, I have an input box to type names and when "submit" is clicked, the text from the box and the player's final score are input into the first text boxes in the leaderboard. That part all works properly. But then when I play again, the new score overwrites the old score rather than adding to the list. And it doesn't seem to be saving to the blank array at all. I feel like that's my problem: saving the data to the array so it opens up next time the game is opened in the same browser. And being able to add to that data without overwriting it. I've read a ton of tutorials and utilized ChatGPT, but so far nothing has worked. The screenshot below shows what I have right now.
I also have the Localstorage set item "highscores" to leaderboardarray.atJSON further down my event sheet when the scores need to be saved.
For clarification, the array shown in the first event all works properly. I'm just having issues saving and pulling from my leaderboard array.
So how should I go about doing this? I feel like I have to be missing something, but I've tried so many different things at this point. Could it just be an order thing? I'm terrible at keeping my event sheet ordered properly...