Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

HELP! - need help for a little code

Inchilat98

Villager
Xy$
0.00
Hi all,
I'm making a script where i toggle the visibility of the currency window in the menu with a script call.

This is what i've wrote
JavaScript:
var alias_Scene_Menu_prototype_createGoldWindow = Scene_Menu.prototype.createGoldWindow;

Scene_Menu.prototype.createGoldWindow = function() {
alias_Scene_Menu_prototype_createGoldWindow.call(this);
this._goldWindow.visible = false;
};
I'm a beginner, please help me out :(
sry for my bad english, hope you will understand what i need.
 

Boy Who Codes

Praised Adventurer
Xy$
0.00
How are you planning to toggle the gold window though? You said script call, but I think you're doing it wrong. If you're doing that in the script call in the events, make this code and save it as a new plugin:

JavaScript:
var alias_Scene_Menu_prototype_createGoldWindow = Scene_Menu.prototype.createGoldWindow;
Scene_Menu.prototype.createGoldWindow = function() {
    alias_Scene_Menu_prototype_createGoldWindow.call(this);
    if ($gameSwitches.value(1)){
        this._goldWindow.visible = false;
    } else {
        this._goldWindow.visible = true;
    }
};
Now, when you turn your switch #1 ON, the gold window will not show.
 
Top