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.

Event-block's location.

Discussion in 'Skript' started by clqrifiedwithaQ, Aug 28, 2021.

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

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    Code (Text):
    1. on right click:
    2.     if event-block is yellow glass:
    3.         if event-block's x-coordinate is 5:
    4.             if event-block's y-coordinate is 54:
    5.                 if event-block's z-coordinate is 2:
    Why doesn't this work and could it be more compact?
     
  2. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    Code (Text):
    1. on right click on yellow glass:
    2.     clicked block's x-coordinate is 5
    3.     clicked block's y-coordinate is 54
    4.     clicked block's z-coordinate is 2
    5.     #action here
     
  3. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    thanks
    --- Double Post Merged, Sep 7, 2021, Original Post Date: Aug 29, 2021 ---
    This doesn't work...


    Code (Text):
    1. on right click on yellow stained glass:
    2.     clicked block's x-coordinate is 4
    3.     clicked block's y-coordinate is 54
    4.     clicked block's z-coordinate is 8
    5.     send "a" to player
    6.                    
     
  4. ShyDoge

    ShyDoge Member

    Joined:
    Jul 31, 2021
    Messages:
    41
    Likes Received:
    1
    Code (Text):
    1. on right click on yellow stained glass:
    2.   set {_loc} to location of event-block
    3.   if {_loc} is "4, 54, 8":
    4.     send "Test was successful" to all players
    5.  
    this should work!
    no guarantees
     
  5. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1

    Doesnt seem to work...
     
  6. ShyDoge

    ShyDoge Member

    Joined:
    Jul 31, 2021
    Messages:
    41
    Likes Received:
    1
    Can you send me your errors?
     
  7. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    The code works. It just doesn't do anything, there are no errors and it reloads without issue, but when I right click the glass at that location nothing happens.
    --- Double Post Merged, Sep 7, 2021, Original Post Date: Sep 7, 2021 ---
    I have more than 1 world. This might be the issue.
     
  8. ShyDoge

    ShyDoge Member

    Joined:
    Jul 31, 2021
    Messages:
    41
    Likes Received:
    1
    possibly
     
  9. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    Code (Text):
    1. on right click on yellow stained glass:
    2.   set {_loc} to location of event-block
    3.   send "%{_loc}%" to all players
    4.   if {_loc} is "":
    5.     send "Test was successful" to all players
    When I test this is sends me the coordinates of the saved location. It says "x: 4.5, y: 54.5, z: 8.5" but when I put that in it still doesnt work
     
  10. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    422
    Likes Received:
    30
    Code (Text):
    1. on right click on yellow glass:
    2.     location of event-block is location(4.5, 54.5, 8.5, player's world)
    3.     # do stuff
    you need to provide decimal values
     
Thread Status:
Not open for further replies.

Share This Page

Loading...