question about variables

howdee.
how do i set a variable to be random between 1 to another variable
thank you
Untested, but I think using the script section of the "control variables" command, you could do something like:
JavaScript:
Math.randomInt(1, $gameVariables.value(VARIABLE_ID));
// where VARIABLE_ID is the id of the variable you're looking to use as an upper limit.

Math.randomInt(min, max) is an extension method provided by RMMZ's core codebase, but I'm not 100% sure if it is usable in script commands and the like.
no it didnt work it gives me the value of 0

but
Math.randomInt($gameVariables.value(VARIABLE_ID)+1)
gave me the result i needed

Thank you
no it didnt work it gives me the value of 0

but
Math.randomInt($gameVariables.value(VARIABLE_ID)+1)
gave me the result i needed

Thank you
Only a small correction:
Math.randomInt(X) gives you a number between 0 and X-1, so you should add 1 to the result if you want a value between 1 and X:

1 + Math.randomInt($gameVariables.value(VARIABLE_ID))

Original thread: https://forums.rpgmakerweb.com/threads/question-about-variables.149042/