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 How To Make Clickable Blocks

Discussion in 'Skript' started by Yodexx, Jul 3, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    Soooo... I'm trying to make a skript that will make it so that when you right click a specific block, with specific meta-data it will run a command. But the thing is I don't know how, and I've also been trying to look up how, but everything I find is just vanilla stuff that I can't even do.

    My Example:
    I'm trying to make a right clickable item that will trade in "souls" for something else. And I need to make a right clickable block to do so. (its an end portal frame btw)

    Can any of you guys help me? I really want this done for my season 2 release of my server.
     
  2. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    228
    Likes Received:
    9
    maybe this?
    Code (Text):
    1. on rightclick:
    2.     if event-block is ...:
    3.         #do stuff ... ?
     
  3. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    That worked! Thank you, but now I don't know how to tell meta data of a specific block with that skript, which that's one thing I need.
     
    #3 Yodexx, Jul 3, 2020
    Last edited: Jul 4, 2020
  4. Detective Vapor

    Joined:
    Jul 2, 2020
    Messages:
    15
    Likes Received:
    0
    This should suit your needs
    Code (Text):
    1. on place of end portal frame:
    2.     player's tool is named "&6Something":
    3.     add location of event-block to {loc::*}
    4.  
    5. on rightclick on end portal frame:
    6.     {loc::*} contains event-block's location:
    7.     #do stuff
     
  5. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    I keep getting errors:

    This is my code:
    Code (Text):
    1.  
    2. on place of end portal frame:
    3.  player's tool is named "&6Soul Well":
    4.   add location of event-block to {clickableblocks::*}
    5. on rightclick on end portal frame:
    6.  {clickableblocks::*} contains event-block's location:
    7.   # Stuff Here
    8.  
    And this is the error:
    Code (Text):
    1. Line 2: Can't compare a slot with 'named "&6Soul Well"' (script.sk, line 2: player's tool is named "&6Soul Well":')
     
  6. DarklordX89

    DarklordX89 Active Member

    Joined:
    Nov 2, 2019
    Messages:
    57
    Likes Received:
    0
    try
    name of tool of player is "&6Soul Well":
     
  7. oZeladon

    oZeladon Member

    Joined:
    Jun 1, 2020
    Messages:
    1
    Likes Received:
    0
    That won't change anything, Harrison.
     
  8. DarklordX89

    DarklordX89 Active Member

    Joined:
    Nov 2, 2019
    Messages:
    57
    Likes Received:
    0
    Code (Text):
    1. on place of end portal frame:
    2.     name of tool of player is "&6Soul Well":
    3.         add location of event-block to {clickableblocks::*}
    4. on rightclick on end portal frame:
    5.     {clickableblocks::*} contains event-block's location:
    6.         # Stuff Here
    its not that hard next time use tabs instead of 1 or 2 spaces
     
  9. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    It worked! Thank you so much :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...