1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved How to check if a player is between 2 coordinates

Discussion in 'Skript' started by FrewtyPebbles, Feb 13, 2019.

  1. F

    FrewtyPebbles Member

    Joined:
    Feb 13, 2019
    Messages:
    2
    Likes Received:
    0
    So as the title says essentially i am trying to make a custom region skript not using world edit or world guard, I have everything in place, all i need help with is how to check if a player is between the 2 xyz coordinates that are stored in variables every 10 seconds. I have searched the docs and other things but cant figure it out please help, thank you.

    Side note: this is my first post on this site and i am relatively new to skript but not programming so please be patient with me. Thank you.
     
  2. Best Answer:
    Post #2 by TPGamesNL, Feb 13, 2019
  3. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    868
    Likes Received:
    50
    Medals:
    You have to check if the player is between each coordinate, so you have to check x, y and z separately. If it's between all of those coordinates, then they're between the locations.
     
  4. F

    FrewtyPebbles Member

    Joined:
    Feb 13, 2019
    Messages:
    2
    Likes Received:
    0
    Thanks man ill try that
    --- Double Post Merged, Feb 13, 2019, Original Post Date: Feb 13, 2019 ---
    so i tried it with just the x coordinate like this and it didnt work, is the format correct? If not how would i fix it? also the {FirstArenaCoord::%loop-index%} and {SecondArenaCoord::%loop-index%} are the two coordinates:
    loop {ArenaName::*}:
    if player's x-coordinate is between {FirstArenaCoord::%loop-index%}'s x-coordinate and {SecondArenaCoord::%loop-index%}'s x-coordinate:

    Edit: Nevermind it does work! i just tested it wrong lol thank you so much!
     
    • Funny Funny x 1
Loading...