JavaScript:
$gameVariables.setValue(159, []);
for(var i = 141; i <= 152; i++) {
$gameVariables.value(159).push($gameVariables.value(i));
} $gameVariables.setValue(160, Math.max($gameVariables.value(159)));
I have 12 variables ID 141 to 152. I want to add them to an array game Var ID 159 to use the Math.max function. Then i will store the index (not the value) to var ID 160. But when I check ,I always get 0.
I mean I produced random numbers for the 12 variables.