2 things comments i like to give.
1/
Localstorage needs time to upload en download things. You can use downloaded data AFTER they are downloaded. Not during or so. Meaning: after a 'get item' you need a condition 'on get complete'. Then you can use the data.
I am sure that step was also in the tut. Look for it.
2/
You can simplify the whole thing by using a dictionary. Store the username in a key (check first for existing). Store de score in the value that goes with the key. Easy to handle. Easy to debug, the contents of the dictionary show in the debugger. And they always wil be a not seperatable pair.
Now, instead of adding a million keys to the local storage, you add just 1 key to it, give it a name you like, and store the json of the dictionary in its value.
You can ofcourse also write the array you use the same way in the local storage. (1 key, 1 value as json) But the array is in your case (only 1 text + just 1 number) just that little to complicated for what it is.