What is wrong with this bit of code?

MagicPizzaGuy

Mother of All Omelettes
Veteran
Joined
Jul 16, 2014
Messages
50
Reaction score
44
First Language
Portuguese
Primarily Uses
RMMV
I used this script, but it doesn't seem to work when playing. Anyone has any idea why?

Code:
$gameVariables.setValue(28, Math.round(Math.random()*3));
switch ($gameVariables.value(28)){
    case 0:
    $gameVariables.setValue(25, ($gameVariables.value(23) + Math.round(Math.random()*6 + 4));
    $gameVariables.setValue(26, ($gameVariables.value(24) + Math.round(Math.random()*6 + 4));
    break;
    case 1:
    $gameVariables.setValue(25, ($gameVariables.value(23) - Math.round(Math.random()*6 + 4));
    $gameVariables.setValue(26, ($gameVariables.value(24) + Math.round(Math.random()*6 + 4));
    break;
    case 2:
    $gameVariables.setValue(25, ($gameVariables.value(23) + Math.round(Math.random()*6 + 4));
    $gameVariables.setValue(26, ($gameVariables.value(24) - Math.round(Math.random()*6 + 4));
    break;
    case 3:
    $gameVariables.setValue(25, ($gameVariables.value(23) - Math.round(Math.random()*6 + 4));
    $gameVariables.setValue(26, ($gameVariables.value(24) - Math.round(Math.random()*6 + 4));
    break;
    default:
    $gameVariables.setValue(25, ($gameVariables.value(23) + Math.round(Math.random()*6 + 4));
    $gameVariables.setValue(26, ($gameVariables.value(24) + Math.round(Math.random()*6 + 4));
    break;
}
 

MagicPizzaGuy

Mother of All Omelettes
Veteran
Joined
Jul 16, 2014
Messages
50
Reaction score
44
First Language
Portuguese
Primarily Uses
RMMV
Im retarded! I forgot a lot of ) everywhere, thanks for pointing out the ) I wouldn't have noticed hahahaha
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Quick! Someone give me a snake pun about moving.
Meet the crew...Arrrr!
Who knew modern medieval was an actual music genre? I don't know what the youtube algorithms are doing but for once they found something actually fascinating:
Yay! Got 3 new frying pans, its weird, but I'm so happy about it.
Yelp. I've discovered that I am one of those people who should not be drinking coffee. Took me a week detoxing off of coffee and switching to tea to realize how badly it was affecting me- and I've been drinking the stuff for years. Yikes!

Forum statistics

Threads
99,526
Messages
966,400
Members
131,152
Latest member
rai1209
Top