- Joined
- Dec 12, 2022
- Messages
- 17
- Reaction score
- 2
- First Language
- portuguese
- Primarily Uses
- RMMV
I make a little script to add a new menu command.
This command turn on the 10th switch. But the games frezzes after being selected
Anyway to prevent the code to frezzes the game?


This command turn on the 10th switch. But the games frezzes after being selected
Anyway to prevent the code to frezzes the game?


JavaScript:
(function() {
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.addCommand("Teste", "comando");
};
Scene_Menu.prototype.createCommandWindow = function() {
this._commandWindow = new Window_MenuCommand(0, 0);
this._commandWindow.setHandler('comando', this.commandcomando.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Menu.prototype.commandcomando = function() {
$gameSwitches.setValue(10, true);
};
})();