Repeat rule every 5 points?
Tim_A
Member, PRO Posts: 60
Hi all,
Just wondering if there's a simple way to repeat a rule every 5 points?
So if score = 5,10,15,20,25,30 do this
rather than
if score = 5 do this
if score = 10 do this
if score = 15 do this
if score = 20 do this
if score = 25 do this
if score = 30 do this
Thanks for any help
Tim
Comments
Create an attribute called game.ZERO and give it the value zero.
When attribute game.ZERO=mod(game.score,5)
.....
This will not work if your score increases by 5 at a time (5+5=10 won't trigger the rule) but you didn't mention that.
If you use the Release Candidate or Nightly Build you don't need the zero attribute because you can put an expression on either side of the rule condition.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Sorry for the late replay... that worked perfectly thank you