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.

how do i check if a block is at a location set in a variable

Discussion in 'Skript' started by zonf, Mar 23, 2021.

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

    zonf Member

    Joined:
    Mar 23, 2021
    Messages:
    2
    Likes Received:
    0
    Code (Text):
    1. on break:
    2.     if event-block is at {%player%.spawnblock}:
    3.         cancel event
    Errors:
    Line 9: Can't compare a block with 'at {%player%.spawnblock}' (script.sk, line 9: if event-block is at {%player%.spawnblock}'s location:')
     
    #1 zonf, Mar 23, 2021
    Last edited: Mar 23, 2021
  2. Shadow Klassic

    Joined:
    Sep 19, 2020
    Messages:
    20
    Likes Received:
    0
    if event-block is at location location(0, 0, 0 0, 0 "world")
     
  3. zonf

    zonf Member

    Joined:
    Mar 23, 2021
    Messages:
    2
    Likes Received:
    0
    i want to do it with a variable, and 2nd it doesn't work
    Code (Text):
    1. on rightclick on cobblestone:
    2.     if player is holding stick named "&bCobblestone generator activator":
    3.         set {%location%.cobblestonegen} to clicked block's location
    4.  
    5. on rightclick on cobblestone:
    6.     if clicked block is at {%location%.cobblestonegen}:
    7.         set {a} to 3
    --- Double Post Merged, Mar 26, 2021, Original Post Date: Mar 26, 2021 ---
    oh wait i can just do this nvm
    Code (Text):
    1. on rightclick on cobblestone:
    2.     if player is holding stick named "&bCobblestone generator activator":
    3.         set {%location%.cobblestonegen} to clicked block's location
    4.         set {%location%cobblestonegen} to event-block
    5.  
    6. on rightclick on cobblestone:
    7.     if event-block is {%location%cobblestonegen}:
    8.         set {a} to 3
     
  4. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Don’t forget to mark it as solved :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...