distant turn "false" "true" a runing script

Hello I'd like to know if it's possible to turn "false/true" as needed.


I guess is a strange question, but I actualy have a script that mess a bit.


so I was wondering when I see all scripts starting like:


($imported ||= {})[:Script_name] = true


If it's like a switch to true/false this script.


If that's possible, explain to me how to do it, just to try in my project


Thanks in advance
Are you asking if that line enables/disables the script?  No, it doesn't.  $imported is simply a list of what scripts you've got in your game, and is only used if one script depends on another being present and wants to check to make sure that script is there as well.  You should not change these values.


To enable/disable a script while the game is running, the script would have to be designed and written with that in mind.
Well, that's too bad for me.


Thank you
If you want to turn an entire script off, just type =begin on the first line and =end on the last line of the script (preferably on separate lines from any other code).


If you want to turn a script's functionality off in the middle of your game, there's usually no built-in way to do that.  But an experienced scripter can probably find the lines where your script is "interfacing" with the gameplay and add a conditional branch to your script to only use the script's functionality if, for example, a certain Switch is ON.  So if it's just one or two scripts that you need to do this with, you can probably get someone in the Classifieds to handle it for about $10 a script, give or take depending on the script's length and complexity.

Original thread: https://forums.rpgmakerweb.com/threads/distant-turn-false-true-a-runing-script.64192/