Hi.
how is your setup?
when die you go to menu scene and level is chosen there?
if so :
You could use a player prefs int to save the index and also a player prefs int to check if level completed. (normally this can be done with a bool, but player prefs does not save bool)
To use player prefs, 1st you need to use 'Player Prefs Has Key' to see if a save exists.
if it does not exist use 'Player Prefs Set Int' 2x
one for index (name key "LevelIndex" for example)
and on for level complete (name key "LevelCompleted" for example)
Set the LevelCompleted value to 2
if it does exist do not save but continue to next state
Then use 'Player Prefs Get Int' and get the LevelCompleted value.
The use a int switch.
Set count to 3 and place 0,1 and 2
(0 is Level not finished, 1 is Level finished, 2 is 1st game started)
if 2 you should transition to the "get random array state" directly.
if 1 you can get the LevelIndex and use 'Array Delete At' if you want to remove that level. and then go to the "get random array state"
if 0 you can get the LevelIndex and use 'Array Get' with the LevelIndex as index.
and skip the "get random array state".
When you do the 'Array Get Random' you should store the index in a variable and then use 'Player Prefs Set Int' with LevelIndex key to save the index nr.