Need help getting Math.radom to load a new number after every keypress now :)

Alright, I have the MC I wanted to move everytime “A” is pressed now. But I still have one more question. Right now I have a random number generated between 1 and 10. Every time that “A” is pressed my horse (for the game) moved across the x axis in an increment between 1 and 10 (the random number). BUT the problem I’m having is that when the “A” button is pressed it loads a random number and uses that number over and over when I press the “A” button.

How do I get it to load a new random number everytime “A” in pressed?