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

how do I make the text in sign

Discussion in 'Development' started by MadeUpadanaYT, Jan 30, 2017.

  1. MadeUpadanaYT

    MadeUpadanaYT Spider

    Messages:
    12
    Can you tell me a way to make the text on the sign.
    Example:
    if we write {TEXT} will be the words "hello"
     
  2. kaliiks

    kaliiks Zombie

    Messages:
    250
    PHP:
    public function onSignChange(SignChangeEvent $e){
     
    $tile $e->getLine();
    if(
    $tile == "Text"){
    $tile->setText("Example");
    }
    }
     
    Last edited: Jan 30, 2017
  3. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    $level->getTile(new Vector3($x, $y, $z))->setText($line1, $line2, $line3, $line4);
     
  4. [deleted]

    [deleted] Guest

    Nah he want that if he type {text} on a Sign that the {text} will be changed to Hello
     
  5. [deleted]

    [deleted] Guest

    Use $event->getLine()
     
  6. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    "if he type {text} on a Sign that the {text} will be changed to Hello" - is Example :)
     
  7. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Use str replace instated if you want to change text
    PHP:
    foreach ($lines as $line$line  str_replace("{text}","hello",$line)
     
    Redux and HimbeersaftLP like 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.