Multiples of a number
Gamepenciler
Artist/Game DeveloperMember, PRO Posts: 326
I'm trying to figure out a code about having reward in every multiples of a number. I can't seem to find a tutorial of this.
Example in score like every 20 points you get an item, like it reaches 40,60,80,.. and so forth.. Doing manually till 999999 is pain the A##.
So how do we do things in just 1 code for a multiples of a number?
Attribute : Score = (every 20 score points?)
Spawn reward.
Artist/Game Developer / Animator at your service..
Comments
Something like this:
Rule:
Numeric expression mod(game.score,20)+1 = 20
Do:
Reward
Can't test it right now, but it should work.
Mental Donkey Games
Website - Facebook - Twitter
It works! thanks! @NipaDidIt
Awesome coding!
Artist/Game Developer / Animator at your service..
Oh just found out when I try the code it rewards at the 19th and it's multiplication.. hmm
Artist/Game Developer / Animator at your service..
Couldn't you do:
if score%multiple = 0 then reward
https://facebook.com/Grishlock
Oh that's more simple and it works thanks @grishlock
Artist/Game Developer / Animator at your service..