Control Variable to Specific Random Numbers

Randomizing a variables' value can only be set from, for example '1-9'.
Is there a way to control a variable to equal to a random specific set of values like; '1, 2, 5, or 7'
You can do $game_variables[X] = [1, 2, 5, 7].sample, where X is the ID of the variable. Alternatively, in the 'Control Variables' section, set it to script and use [1, 2, 5, 7].sample
You can do $game_variables[X] = [1, 2, 5, 7].sample, where X is the ID of the variable. Alternatively, in the 'Control Variables' section, set it to script and use [1, 2, 5, 7].sample
Thank you! The second option is definitely more convenient to use.

Original thread: https://forums.rpgmakerweb.com/threads/control-variable-to-specific-random-numbers.127623/