Adding points into attribute into some specified level?
DanielDoe
Member Posts: 307
Example:
I have an integer attribute called "Life". Many Items can add points into this attribute. CoinA +10, CoinB+20, Coin+30.
The problem is to keep the life attribute on max level 100 (Life=100) - not more. If Life=90 and I take CoinC it makes 120 and I would like to keep it 100. Is there any way to do that?
I have an integer attribute called "Life". Many Items can add points into this attribute. CoinA +10, CoinB+20, Coin+30.
The problem is to keep the life attribute on max level 100 (Life=100) - not more. If Life=90 and I take CoinC it makes 120 and I would like to keep it 100. Is there any way to do that?
Best Answer
-
RThurman Posts: 2,880Try something like:
Change Attribute: Life To: min(100, Life+CoinC)
The min(x,y) function only returns the minimum of the two values. So, in this case the most that life can ever be is 100.
Answers