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 Is there a way to use custom named buttons in Skript

Discussion in 'Skript' started by AlphaBeta906, Sep 30, 2020.

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

    AlphaBeta906 Member

    Joined:
    Sep 30, 2020
    Messages:
    4
    Likes Received:
    0
    I am currently using Skript on my server and I came across this error while programming the keycards

    Code (Text):
    1. on right click on "Alpha Only":
    2.     if name of player is "AlphaBeta906":
    3.         send "&aAcsess Accepted!" to player
    4.     else:
    5.         cancel event
    6.         send "&4Acsess denied!" to player
    So here is the code in general, when a player right clicks on a button named "Alpha Only" check if the user is AlphaBeta906. The problem in the code is the "on right click on 'Alpha Only':" line. So please let me know is there is a way to make custom named buttons work in Skript

     
  2. Best Answer:
    Post #8 by Time4Games, Oct 5, 2020
  3. Skoll

    Skoll Active Member

    Joined:
    Sep 2, 2020
    Messages:
    65
    Likes Received:
    6
    There is no way to detect with skript, custom names in items when in world, only when in inventories. What do you want to do ? Explain that, maybe I can help you.
     
  4. AlphaBeta906

    AlphaBeta906 Member

    Joined:
    Sep 30, 2020
    Messages:
    4
    Likes Received:
    0
    I want to have a specific button with custom name not in the inventory but in a block and do something when pressed. Please tell
     
  5. Skoll

    Skoll Active Member

    Joined:
    Sep 2, 2020
    Messages:
    65
    Likes Received:
    6
    You will need the location of the button to detect which button you want. Repeating: blocks cannot carry custom names, only skript name and raw name for them, which is the same of id.

    Targeted block is a button:
    Location of targeted block is {location}:
    #do something
     
    #4 Skoll, Sep 30, 2020
    Last edited: Sep 30, 2020
    GRRRilla_Ninja likes this.
  6. AlphaBeta906

    AlphaBeta906 Member

    Joined:
    Sep 30, 2020
    Messages:
    4
    Likes Received:
    0
    Thanks for the answer, although I don’t like why Skript does’nt allow custom names in buttons. It’s also very time consuming but I’ll take the answer. Thanks
     
  7. Skoll

    Skoll Active Member

    Joined:
    Sep 2, 2020
    Messages:
    65
    Likes Received:
    6
    I guess that skript cannot change that because minecraft behavior.
     
  8. AlphaBeta906

    AlphaBeta906 Member

    Joined:
    Sep 30, 2020
    Messages:
    4
    Likes Received:
    0
    Also is it nessisary to get a on click?
     
  9. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    203
    Likes Received:
    4
    you can give a custom nbt to the button and then detect it using skript but the nbt would get deleted if you restart the server
     
Thread Status:
Not open for further replies.

Share This Page

Loading...