I have several important variables in my ScripCraft plugin that I want the player to specificate. Is there a way to create a config file?
Yes. The easiest way is to use the built-in persist()
function like this...
var playerName = player.name;
var playerConfig = persist(playerName + '-myconfig', {} );
playerConfig.strengths = ['flight', 'magic' ];
playerConfig.weaknesses = ['arachnophobia' ];
The player config will automatically be saved to a .json
file in the scriptcraft/data/
directory.