Hi everyone,
so I need a script call that, if a switch is turned on, sets a random value of a variable between 0 and 3.
If that variable is 3 the script call is supposed to give the player an item.
Here's what I've got.
if ($gameSwitches.value(329)) {
$gameVariables.setValue(9, Math.randomInt(3))
if ($gameVariables.value(9) === 3) {
$gameParty.gainItem($dataItems[15], 1);}
}
Which sadly does nothing. What am I doing wrong?
so I need a script call that, if a switch is turned on, sets a random value of a variable between 0 and 3.
If that variable is 3 the script call is supposed to give the player an item.
Here's what I've got.
if ($gameSwitches.value(329)) {
$gameVariables.setValue(9, Math.randomInt(3))
if ($gameVariables.value(9) === 3) {
$gameParty.gainItem($dataItems[15], 1);}
}
Which sadly does nothing. What am I doing wrong?