upgrade function
you can use this to add upgrades to your project. inputs: reset: resets the level of the function to 0 price array reference: connect an array reference to this function. the array contains numbers representing prices of the levels. an array with numbers 5, 10, 20 would make level 1 cost 5 points, 2 cost 10 points and 3 cost 20 points budget: number that determines how much points you have max level: limits the number of times you can upgrade the script outputs: upgraded: outputs true if function was upgraded (inner variable incremented) other true/false outputs will output false when this is true price: outputs the price of the upgrade use to determine how many points you have to take away from the player not enough to buy: outputs true if budget is < price of the current level ,other true/false outputs will output false when this is true maxed out: outputs true if max level < function level (variable inside) other true/false outputs will output false when this is true level: outputs the current level (value of variable inside) ---------------------------------------------------------- how to set up? brick that gets value of variable/stat that you want to use as currency for buying the upgrade the value goes into the function array goes into the function represeting the upgrade prices of the function max upgrade can be manually set to a constant trigger function exec output goes trough some logic that takes away the points that the player spend (only if upgraded is true), just subtract the number in the price output from the variable or stat that you want to use for upgrading
- Published
- October 21, 2026 at UTC
- Updated
- October 21, 2026 at UTC
- Version
- 1
- Share code
x1q-89d-54z