1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Random Number

Discussion in 'Plugin Help' started by kombanwa, Jul 26, 2020.

  1. kombanwa

    kombanwa Spider

    Messages:
    8
    Hello. Today I want to randomize 5 numbers and water. Those numbers come together to be a set of numbers in $num and they come.

    A plugin that I need to random set numbers to random team numbers.

    PHP:
    //random set of number = 26483

    $num 26483//value of random
    /*use $num to run something and $num = 26483*/
     
  2. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    can you explain more please? i confused :(
     
  3. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    what do you want to do?
    what plugin do you want to create?
    what code you need?
    and what is your problem?
     
  4. kombanwa

    kombanwa Spider

    Messages:
    8
    Sorry. I am not answer you.
     
  5. kombanwa

    kombanwa Spider

    Messages:
    8
    1. I want to random the number and get value at random to set to $num
    2. I want to create Team Plugin
    3. I want Random and set to $num
    4. My problems are can't random 5 number and get value at random to set to $num
     
  6. kombanwa

    kombanwa Spider

    Messages:
    8
    Bad Eng. I think you can understand.
     
  7. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    PHP:
    to make a random number
    $num 
    mt_rand(0,1);
    0 is the min and 1 is the max
    it should either make $num 0 or 1
     
    Znightmare123 and Primus like this.
  8. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    if u want to set multiple numbers into something use an array
    PHP:
    $array = [$num,$num1,$num2,$num3,$num4];
     
  9. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    Sorry, i cant underestand what do you want to do, you need to get index of what?
    i think you want to create rand number? if you want to get random 1 - 5 you should use
    PHP:
    <?php
    $num 
    rand(15);
    echo 
    $num;
    //this will get random number 1 - 5 i dont know where do you want to use, so icant help you perfect :(
     
  10. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    But dont use echo Lol
    just use $num in what where you want and done.
     
  11. tokoyami ds

    tokoyami ds Spider Jockey

    Messages:
    25
    You can find out the answer to your question by reading the Size plugin

    ((Sorry for bad english))
     
  12. Primus

    Primus Zombie Pigman

    Messages:
    749
  13. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    is your problem solved?
     
  14. kombanwa

    kombanwa Spider

    Messages:
    8
    lol. My code like you but it not work because i forgot ;
    lol
     
  15. kombanwa

    kombanwa Spider

    Messages:
    8
    THANK YOU EVERYONE
     
  16. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    o_O:D
     
  17. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    No problem ;)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.