Make players not leave a region

Discussion in 'Plugin Development' started by legostarwarszach, Jun 8, 2013.

Thread Status:
Not open for further replies.
  1. How would I make it where players cannot leave a certian region defined in a config?

  2. Offline


    I would do something like this:

    1. Two location coordinates (X,Y,Z) would be defined somewhere, showing two (diagonally opposite?) vertices of a rectangle

    2. Using the PlayerMove event, get their moveTo location from the event.

    3. Separate the two config locations into a min and max value for each axis. Min X, Max X, etc.

    4. Check each axis of the moveTo location to check if it's >= the min and =< the max.

    5. if it fails the check, cancel the event.
    legostarwarszach likes this.
Thread Status:
Not open for further replies.

Share This Page