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

Signs

Discussion in 'Facepalm' started by LucGamesDE, May 10, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    I have 3 signs in my world and an array with to strings (test and test2). How can I randomly set the strings on the signs? Only one string with one sign. So one sign keeps empty
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    the following code will assign one of the two random strings to a one of the three random signs.
    PHP:
    $string $stringArr[mt_rand(0,1)];
    $signTile $tileArr[mt_rand(0,2)];
    $signTile->setText($string);
     
    Last edited: May 10, 2017
    EdwardHamHam likes this.
  3. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Lol. This only sets a random value of the array to the sign. Please read the question carefully
     
  4. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Look at what @jasonwynn10 posted carefully. You're making it sound like you know what you're doing, so why ask for help?
     
  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.