Not-working formula

Hello people! I have a little problem in my project. 


Some skill for one of my characther uses this formulae :


if a.state?(79); a.mat ; b.add_state(80); else;a.mat ; b.add_state(78); end


The conditional branch works as it should, but no damage is dealt, either way. Any wonder why?


Thanks for help and have a good day! 😀
because the last value (the one that will be returned for the formula) must be always numeric. breaking the lines your formulas is like:


if a.state?(79)
   a.mat
   b.add_state(80)
else
   a.mat
   b.add_state(78)
end


in both cases, the returning value (the last value) is not numeric.


Place the add state before the numeric stat


if a.state?(79); b.add_state(80); a.mat; else; b.add_state(78); a.mat; end
Works great! Thank you!


Topic can be closed now.

Original thread: https://forums.rpgmakerweb.com/threads/not-working-formula.57749/