Adding points into attribute into some specified level?

DanielDoeDanielDoe 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?

Best Answer

  • RThurmanRThurman Posts: 2,879
    Accepted Answer
    Try 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

Sign In or Register to comment.