Range of variables in a conditional branch

Hello, I'll be pretty straightforward. I have an npc whose dialogue changes if variable x equals a number from 1 to 10. This means, he'll do different things according to the number the variable equals.

I'd like to check if a variable equals MORE than one number at a time. This means, I want a command that tells the program to check if variable x equals 4, 5 AND 6 at the same time. Just to name an example. This is a resource that I'd like to recreate for other events as well in order for me not to write a command per each number in the world that variables can equal.

This is the script call in the conditional branch that I came up with searching about Ruby operators but it hasn't worked out. It seems like no matter the value of the variable, it's not reading any but this script call even when the variable is 0. Hope you can help me out:
export202309152339300870.png


Pd: I also tried to double the equality symbol (==), not write the brackets, use commas and the connector AND.
Couldn't you just use the normal "check variable" command, but stack a few in there?
Couldn't you just use the normal "check variable" command, but stack a few in there?
What do you mean? The condition for variables only check one at a time, I guess.
Just realized something....
How the hell is Var58 going to equal 1,2, and 3 at the same time?
Just realized something....
How the hell is Var58 going to equal 1,2, and 3 at the same time?
Not like that, more like from 1 to 3.
So you mean, if Var58 is 1, 2, or 3?
In that case:
Check if it's one. No? Than...
Check if it's two. No? Than...
Check if it's three. No? Than..etc etc
This is the script call in the conditional branch that I came up with searching about Ruby operators but it hasn't worked out. It seems like no matter the value of the variable, it's not reading any but this script call even when the variable is 0. Hope you can help me out:
Well the first mistake is that your assigning the value not comparing.
= is assigning, == is comparing.

Second there could be a few ways to doing this but the way you are trying is comparing an integer to an array.
Try this
[1,2,3].include?($game_variables[2])
(1..3) === $game_variables[2]
The line above also works smoothly as long as the range is continuous and you do include the parentheses and the === equality operator there.
Thanks to everyone, as soon as I go back to eventing, I'll try everything you've suggested!

Original thread: https://forums.rpgmakerweb.com/threads/range-of-variables-in-a-conditional-branch.162135/