Maintain score for multiple attempts and levels

I am looking out for some advice on maintaining player scores in my game.

My game has multiple levels and allows player to repeat a given level multiple times. At each level player can get some score and coins which will be added to the global score and global coincount if the player completes the level successfully. The cumulative score and coin count will be available as baseline for the next level.

I am using another variable LevelAttempt that is incremented every time a level is completed. I would like to know how I can use it to track attempts for multiple levels. Will it work if I use LevelAttempt as scene variable like below? Will there be a conflict if I use the same variable name in all the scenes? How can I store/retrieve the multiple values for multiple levels?

Level 1
LevelAttempt = 1; Level Score = 300
LevelAttempt = 2; Level Score = 250

Level 2
:
:
LevelAttempt = 5; Level Score = 2300

A scene variable only exists while the scene it belongs to is active. Once the scene is stopped and changed to another, the variable and it’s value are deleted.

You’d be better off using a Global Variable, which lasts while the game is running.

Look at using a Global Structure Variable, the children’s name being the level, and an other structure as the value that contains each attempt and it’s score.

Something like:
image

With the event:

Not sure why we need two structures as you suggested. Do you mean hierarchical structure like this?

And then use in events like this:

image