😅 Whoops, yes, sorry for the confusion! I edited my previous post.
This checks if the value of variable 1388 is less than the value of variable 1381...and it does that check up to 6 times (once per ID in the list). But you want to check the value of variable
id (different value each time), right?
Try this instead:
const v = $gameVariables.value(1388); [1387,1386,1385,1384,1383,1382].every(id => v < $gameVariables.value(id))
I.e.
- Store the value of game variable ID 1388 in a temporary variable
v (will be deleted after the script call ends);
- Loop through the list of IDs 1387, 1386, 1385, 1384, 1383, 1382:
- For each ID, test if
v is less than the value of the game variable with that ID.
- Return:
true if every ID passed the test;
false otherwise.
(I double-checked, pretty sure the code matches the description this time.
😊)
In case it helps to clarify what's going on: the
id => stuff part is called an "
arrow function".
every calls that function once per value in the array, with
id replaced by the value each time.