The Daily Click ::. Forums ::. Klik Coding Help ::. Is it possible to have 'If number is between 1 and 10' do this... rather than have 10 different events?
 

Post Reply  Post Oekaki 
 

Posted By Message

eyeangle



Registered
  12/06/2003
Points
  1683
23rd February, 2014 at 23/02/2014 21:51:40 -

I have a random number generating between 1 and 101

If it lands between:
1-10 something happens
11-20 something happens
21-30 something happens
...
91-100 something happens

If it lands on 101 something cool happens.

So instead of having 101 events, how can I do this only have 10 events?

Edited by eyeangle

 
theonecardgame.com

Riptide



Registered
  26/07/2013 21:07:20
Points
  101
23rd February, 2014 at 23/02/2014 22:12:01 -

Hey there, i don't exactly get what you want to do but have you tried that ?


• RandomNumber >= 1
+ RandomNumber <= 10
=> Something happens between 1 and 10

• RandomNumber >= 11
+ RandomNumber <= 20
=> Something happens between 11 and 20

• RandomNumber >= 21
+ RandomNumber <= 30
=> Something happens between 21 and 30

• RandomNumber = 101
=> Do that fancy stuff

And so on...

Don't forget to put "Only one action when event loops" if you want that thing to happen once
or you could get that number, store it somewhere and set it back to 0, just do whatever you want
Have a good day/evening/night/whatever !

Edited by Riptide

 
Working on some engines, working for the fun !

eyeangle



Registered
  12/06/2003
Points
  1683
23rd February, 2014 at 23/02/2014 22:36:37 -

Thanks, that worked. For some reason I'd ruled that out. I just assumed that > wouldn't be affected if I put in a < in the same event... oh well, thanks!

 
theonecardgame.com

Riptide



Registered
  26/07/2013 21:07:20
Points
  101
23rd February, 2014 at 23/02/2014 22:40:28 -

No problem

 
Working on some engines, working for the fun !
   

Post Reply



 



Advertisement

Worth A Click