Comparing two or more variables

Hi!

In the begining my game, there's a small questionary to setup the main actor's personality. It's something very simple, consists in a few question and each answers add some value to one of 4 variables.

At the end I try to compare to see which variable has the higher value, defining the actor's personality. Here's the event:

<Question 1>

<Answers>

repeats until the last question, then

Script call:

(variable #5 is named Results)

var i = $gameVariables[1];var j = $gameVariables[2];var k = $gameVariables[3];var l = $gameVariables[4];if (i > j || i > k || i > l) {$gameVariables.setValue(5, 1);} elseif (j > i || j > k || j > l) {$gameVariables.setValue(5, 2);} elseif (k > i || k > j || k > l) {$gameVariables.setValue(5, 3);} elseif (l > i || l > j || l > k) {$gameVariables.setValue(5, 4);}If Results == 1

<text: You are personality X>

end

If Results == 2

<text: Your are personality  Y>

etc...

_________________

The game reads the code, does not return any error but the text with personality results does not appear D:

Can someone helps me please? @_@
You can't access the $gameVariables array like that in MV.

To get the value you have to use:

Code:
$gameVariables.value(ID);
worked! thanks ^^

Original thread: https://forums.rpgmakerweb.com/threads/comparing-two-or-more-variables.51749/