If the hour is even...

If hour/2 gives a remainder of 1, it's odd.
  SpawnMonster (this)
}
If hour/2 gives a remainder of 0, it's even.
\\Do nothing
}

How should I do this?


game.hour = game.hour % 2
If result = 1
  SpawntMonster (this)
}

RIght?


Should work. or just:

if (game.hour % 2 = 1) {
  SpawnMonster (this)
}

In most programming languages I'm used to, you could just do if (hour % 2) {, but I think Quest makes you include the = too.


Looks good! Thank you!


Log in to post a reply.

Support

Forums