Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you make a random number stored in a variable?

Comments in 'Plugin Development' started by Renzo, May 29, 2014.

  1. Renzo
    Offline

    Renzo Active Member

    Joined:
    Mar 12, 2014
    Posts:
    96
    Minecraft User:
    Renzo_4
    Hello People,

    I have a question: Is there a way to make a variable that has a random value?
  2. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    Yes. For example, if you want a random number between 1 and 10:

    PHP:
    $variable rand(1,10);
    Comedyman937 likes this.

Share This Page

Advertisement