var tempArray = [$gameVariables.value(101), $gameVariables.value(102), $gameVariables.value(103), $gameVariables.value(104)];
Array.max = function( array ){
return Math.max.apply( Math, array );
};
idk what this is to be honest. So basically I have 7 event tied to 7 variable and whichever variable is highest thats the event to occur.Are you looking for something like this?
Code:var tempArray = [$gameVariables.value(101), $gameVariables.value(102), $gameVariables.value(103), $gameVariables.value(104)]; Array.max = function( array ){ return Math.max.apply( Math, array ); };
bex = 0
$gameVarables.setValue(8, 0)
for (var a = 1; a <= 7; a++) {
if ($gameVariables.value(a) > bex) {
bex = $gameVariables.value(a)
$gameVarables.setValue(8, a)
} }
He can do that the first Time he goes through them. No need for a second loop. But yes 9 Variables he need.
In the script snippet above i just used 8 game variables and a 9th temporary one that is deleted the moment the snippet finishes.
@Jade010, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.