Functions
Run JavaScript functions in your script
Description
Reversible Functions
'use strict';
// Persistent Storage Variable
Monogatari.storage ({
player: {
intelligence: 0,
ability: 0,
strength: 0
}
});let script = {
// The game starts here.
'Start': [
'h Currently you have {{player.intelligence}} points of Intelligence but you seem far more intelligent, how about we add five points?',
function () {
this.storage ('player', {
intelligence: this.storage ('player') + 5
});
return true;
},
'h There you have it, you now have {{player.intelligence}} points of Intelligence',
'end'
]
}Normal Functions
Async Functions
Last updated
Was this helpful?