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

Solved How do you make someone teleport using PlayerMoveEvent?

Discussion in 'Help' started by esh123cookie, Sep 23, 2021.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Player->getX,Y,Z should return rounded values, so as long as you're showing us your right code, it should work fine.
     
    minijaham and Axon like this.
  2. Axon

    Axon Zombie

    Messages:
    276
    Dude, you just solved it. Incorrectly but you did.

    the values of $X and $Z returns a float, a non rounded value.

    Change your $X variable to this:
    PHP:
    $X round($player->getX());
    Change your $Z variable to this:
    PHP:
    $Z round($player->getZ());
     
    minijaham and Kyd like this.
  3. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Code:
    02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    [02:01:01] [Server thread/NOTICE]: World
    yup the xyz isnt showing up even when I walk ontop of the cords
     
  4. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Ill try it out, I just got more pmmp builds so Ill test it out right now
     
  5. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    AND IT WORKS, Thank you for the help @Kyd, @ErikX, @minijaham
     
    Kyd 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.