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

Particle specific to player

Discussion in 'Development' started by Zuruki, May 23, 2017.

  1. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    So, I want when a player join there Is a particle floating text , shows their name and online count of server... it stays there. only they can see it, specific to them only! And, the player online count update every time player join and quit etc.
    How?
     
  2. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Have you tried first ?
     
  3. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    Yes, I foreach all particles and update player count in task. But how make it specific to player, I have bad English I am France ! , sorry :(
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Send us your code, that'll help. Even if it doesn't work.
    If you want to send a particle to a specific player, define the 2nd argument for Level::addParticle()
    PHP:
    /** @var Player $player */
    Level::addParticle(Particle::class, [$player]);
     
    jasonwynn10, Zuruki and 0x15f like this.
  5. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Send us your code

    Really you come from France ?
    If yes send me a private message in french :)

     
  6. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    His grammar looks like it was French to English.
     
  7. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    So I put player in array?
     
  8. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    Yes, put the var representing the player in an array and pass it as arg 2 in Level::addParticle();
     
  9. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    Ahh, so do I have to use an event?
    For example, PlayerJoinEvent? but what if a player joins, particle spawn, then he quit , then he join again, then there is 2 particle !
     
  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.