Hi
I am trying to check for the values 2, 3 or 4 in Variable3.
I am using a conditional branch for Variable3 and was attempting to use the script.
I tried:
$game_variables[3] = 2 || 3 || 4and
$game_variables[3] = 2..4I thought it might be something like this, but not fully sure how it handles (these don't work).
I though it might also be == but realised that this is only if is equal to all 3 values.
Any help is great.
[Ace] Checking multiple values from one in a variable.
● ARCHIVED · READ-ONLY
-
-
You mean,
$game_variables[3] == 2 || $game_variables[3] == 3 || $game_variables[3] == 4?
Or you can use:
Code:[2,3,4].include?($game_variables[3]) -
Thanks, both work well.You mean,
$game_variables[3] == 2 || $game_variables[3] == 3 || $game_variables[3] == 4?
Or you can use:
[2,3,4].include?($game_variables[3])
I will use the second as I can add to it later on.