GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Adding points into attribute into some specified level?

DanielDoeDanielDoe Posts: 307Member
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,815Member, Sous Chef, PRO
    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

This discussion has been closed.