I'm trying to design a custom resource through basic Javascript that relies on using a custom variable. I can't quite figure out how to put a limit on the amount you can generate though.
I've tried
but that runs into an issue where if the amount generated goes over 100 (i.e. Skill is at 99 but if 2 is added it goes up to 101) it stays at that value unless it's depleted.
Is there a simple solution to this?
I've tried
Code:
var Skill = $gameVariables.value(1).clamp(0,100);
Is there a simple solution to this?