set variable to random number help

i made a battle event that occurs once each 2 turns. in this event, a variable is randomly going to be set between 1 and 3. however there are times where, for example, the variable was set to number 3 and the next time the event occurred, the variable was set to 3 again. is there any way to make it so that the next number can't be the same as the one that's already in the variable?
Of course.  Have a "last random" variable as well as your random variable.

For example, have Variable 10 store the current selection and Variable 11 store the last selection.  Make sure to start Variable 11 at 0.  Then, to choose the new random variable, use the following event structure:

Loop

Variable 10 = Random 1..3

If Variable 10 is not equal to Variable 11

Set Variable 11 equal to Variable 10

Break Loop

End

Repeat Loop

(Do whatever processing you need to do with Variable 10 like you're doing now)

Original thread: https://forums.rpgmakerweb.com/threads/set-variable-to-random-number-help.38105/