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

im makeing a cratekey plugin and i need to know how to randomize what a player gets how do i do that

Discussion in 'Development' started by abimalek, Oct 11, 2017.

  1. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    PHP:
    /** @var Item[] $item **/
    $items = [];
    $key array_rand($items);
    $randomItem $items[$key];
     
  3. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    would this pick one random item? upload_2017-10-11_20-20-33.png
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    iiFlamiinBlaze likes this.
  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.