Getting location to spawn NPC

Discussion in 'Plugin Development' started by draypvp, Apr 16, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    draypvp

    What would be the position to spawn a NPC behind a player? e.g = posistion above and behind a players head?
     
  2. Offline

    Stackore

    p.getLocation

    Oh sorry, p.getLocation spawn same position as the player

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
    CptnPummeluff likes this.
  3. Offline

    draypvp

    No i mean like, what would the actual numbers of the posistion be.. eg. 3, 0, 3 that spawns it to the right of it
     
  4. Offline

    MrInspector

    If I was you i'd test them out, I believe 1, 0, 1 is in front of the player, -1, 0, 1) is on the left of the player, 1, 0, -1 is the right of the player, and -1, 0, -1 is the back of the player, assuming that you're getting the player's location.
     
  5. Offline

    draypvp

    Ok so -1, 0, -1 is what im looking for but now what would i change it to to make it spawn like this:
    http://gyazo.com/5599b1553f2fb7f4bda7600186ae7f74 I want to make it spawn in behind, and above the player as stated in the poorly drawn picture l0l
     
  6. Offline

    MrInspector

    Actually, ignore what I just said, I edited it out, hopefully I can understand you on this, but just change the parameters (-1, 0, -1) to your likings, probably something like (-1, 0, -5)

    If you want to make it above the player, you'll have to get the player's location, and change the Y (as you can see it's currently 0) to something else, something to like 2.
     
  7. Offline

    draypvp

    So what your saying is that I should do.. -1, 2, -5 for it to be above and behind the player?
     
  8. Offline

    MrInspector

    Probably -5 would be a little too far behind, but if that's what you're shooting for then it should be.
     
Thread Status:
Not open for further replies.

Share This Page