You are changing the class of the actor ID stored in variable 3. We never see where you set the value of that variable.
This is part of what I was talking about with the unnecessary use of variables...if you have too many that you only use once, it's easy to lose track. That line should read:
Code:
$gameActors.actor($gameParty.members()[0].actorId()).changeClass($gameActors.actor($gameParty.members()[0].actorId()).currentClass().id+1, true)
And then you don't need the line of script with n=. Or you can put back in the additional variables at the top, just substituting the appropriate numbers when his original script references $gameVariables.value(X), and putting the correct number for the X.
But if you're copying code, you need to copy it exactly...you can't just leave out those two variables he set at the top because he
did use them later. So if you take out those variable declarations, you need to then replace the places where they're referenced. (and one of those references to a variable...was just to set
another variable 😮 Good lord, dude...)