What is wrong with this bit of code?

MagicPizzaGuy

Mother of All Omelettes
Veteran
Joined
Jul 16, 2014
Messages
50
Reaction score
41
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;
}
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,816
Messages
947,154
Members
129,035
Latest member
Tauron7
Top