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.

Solved Why is this not working?

Discussion in 'Skript' started by SoMuchWessel, Feb 14, 2018.

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

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Hi guys,

    I wrote this code:
    But it sends an error:
    Error: Can't compare a block with ('at location at 1304')


    Code (Skript):
    1. on right click:
    2.     if event-block is at location at 1304, 71, 1392:
    3.         send "hey" to player


     
  2. Best Answer:
    Post #12 by MartinOdum, Feb 15, 2018
  3. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    if location of event-block is at location at ...
     
  4. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Error:
    Cant compare a location with ('at location at 766' ~
     
  5. GamingGeek

    Supporter

    Joined:
    Aug 1, 2017
    Messages:
    46
    Likes Received:
    0
    What are you trying to do? I don't think there's an event-block in the on click event.
     
  6. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    I want to check and run a command if the player rightclicks on a chest at coordinates
     
  7. GamingGeek

    Supporter

    Joined:
    Aug 1, 2017
    Messages:
    46
    Likes Received:
    0
    Try this,
    Code (Skript):
    1. command /settargetblock [<string>]:
    2.     trigger:
    3.         set {_block%arg-1%} to target-block
    4.        
    5. on right click:
    6.     if target-block is {_block1}: #If you did '/settargetblock 1', it would be {_block1}
    7.         send "Hi" to player
    I haven't tested it, but from what I know, that should work/
     
  8. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    I managed to think of another way but i get an error:


    Code (Skript):
    1. on rightclick:
    2.     player is in region "mindroom":
    3.         event-block is a chest:
    4.             if block 2 blocks under the event-block is dirt:
    5.                 send "yes" to player
    Error: event-block is not a direction

    Anyone know a solution?
     
  9. GamingGeek

    Supporter

    Joined:
    Aug 1, 2017
    Messages:
    46
    Likes Received:
    0
    Try target-block
     
  10. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Error: Cant compare 'block 2 blocks above target-block' with an item type
     
  11. GamingGeek

    Supporter

    Joined:
    Aug 1, 2017
    Messages:
    46
    Likes Received:
    0
    Try the way I did it.
     
  12. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    the ways you did. will not working, cuz youre working with local variables.
     
  13. MartinOdum

    MartinOdum Member

    Joined:
    Jan 26, 2017
    Messages:
    112
    Likes Received:
    13
    use "2 meters" instead of "2 blocks". it use to work fine but broke a few versions ago on bensku's build
     
  14. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Thanks, this solved it!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...