Random Variables

Started by Mr_Alpha on Wed, 03/23/2016 - 22:57
Last seen on 00:45, 2. Mar 2018
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Random Variables
Wed, 03/23/2016 - 22:57

Hi everyone,

 

I'm trying to create a mod where if you type in a command it tells you to pick a number one through ten. I want it to then randomize a whole number 1-10, but there's not button to set a variable to random # - #. Does anyone know how to do this?

 

Thanks.

Last seen on 22:02, 18. Oct 2018
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Something like Math.round
Wed, 03/23/2016 - 23:59

Something like Math.round(Math.random()*10)

Last seen on 00:45, 2. Mar 2018
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Something like Math.round
Thu, 03/24/2016 - 14:03

@#1 Would I have to put that in custom code? Like, go to the set variable menu and then where it asks what to set it to, type Math.round(Math.random()*10)? And I thought Math.random was used as Math.random(x) to pick a number from 1 to x?

Last seen on 22:29, 23. Aug 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Same question. PLZ HELP!
Wed, 01/24/2018 - 14:25

Same question. PLZ HELP!

Last seen on 22:29, 23. Aug 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I'm making random mob drops…
Wed, 01/24/2018 - 14:31

I'm making random mob drops and i need help D:

Last seen on 22:29, 23. Aug 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
3 months ago I was hoping…
Mon, 03/05/2018 - 02:44

3 months ago I was hoping someone would answer. Now I'm just bored.