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 out 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.

Fetch and check region from player in water?

Discussion in 'Skript' started by mmaalex22112, Aug 5, 2020.

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

    mmaalex22112 New Member

    Joined:
    Aug 3, 2020
    Messages:
    5
    Likes Received:
    0
    Hey all,
    I've been recently trying to figure out how to check the region of a player who enters water. Right now I have this:
    Code (Text):
    1. on any movement:
    2.     if block above the block below player is water:
    3.         if block below region "pk1-aqua-w1":
    4.             message "&8&lCrazed Man: &r&aThis is water"
    I would prefer to not use on any movement to spare resources so I also tried something like this.
    Code (Text):
    1. on walking on water:
    2.     if block above the block below player is water:
    3.         set block above the block below player to {watertest}
    4.         if region at {watertest} contains "pk1-aqua-w1":
    5.             message "&8&lCrazed Man: &r&aThis is water"
    Nothing I have tried works so far.
    Help would be greatly appreciated!
    Thank you.
     
  2. SkriptLearner

    SkriptLearner Member

    Joined:
    Jul 21, 2019
    Messages:
    45
    Likes Received:
    0
    Hey mmaalex22112,

    Try using:
    Code (Text):
    1.  on move on water:


    More information on this can be found at: http://en.njol.ch/projects/skript/doc/events/#move_on

    Also, you will not need any of the other if statements checking if they are in water once you use this.

    Just another note relating to your code: you do not need
    Code (Text):
    1. block above block below player
    when
    Code (Text):
    1. block at player
    should give the result you want.

    Another thing is I believe you are trying to set {watertest} to the block not the block to {watertest} however in your code you are trying to set the block to {watertest}. This is possibly the reason it is not getting past there.

    I hope this helps!
     
    #2 SkriptLearner, Aug 5, 2020
    Last edited: Aug 5, 2020
  3. mmaalex22112

    mmaalex22112 New Member

    Joined:
    Aug 3, 2020
    Messages:
    5
    Likes Received:
    0
    Hey, thanks for the reply.

    I now have

    Code (Text):
    1. on move on water:
    2.     if block at player is water:
    3.         set {watertest} to block at player
    4.         if region at {watertest} contains "pk1-aqua-w1":
    5.             message "&8&lCrazed Man: &r&aThis is water"
    It still does not work sadly.
    "Can't understand this event 'on move on water'"
     
    #3 mmaalex22112, Aug 5, 2020
    Last edited: Aug 5, 2020
Thread Status:
Not open for further replies.

Share This Page

Loading...