Good day I want to create a global variable with which depending on the number of the variable unlocking levels, but here a problem arises because in level 1 that is where you start I need to put the maximum score to compare it with the score that has just been obtained in order to be able to add points to the global variable, that is, if the maximum score is 1 and this time 3 points have been made, then the 3 points will not be added because you already have one that went up to the global variable, then I want that compares the maximum score with the score obtained now and so the point obtained is subtracted the maximum score and so then raise the remaining 2 points to the global variable, I do not know if I explained myself.
In conclusion, I want to create a global variable with which, depending on the number of points, unlock levels and, in turn, these points obtained in each level are not greater than what can be obtained (in this case I want the maximum of points is 3) so I can not get 100 points in the first level, with what I want to create a comparison-subtraction between the points obtained minus the maximum score and the result that goes up to the global variable