Solved Is there a way to use custom named buttons in Skript

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

AlphaBeta906

Member
Sep 30, 2020
4
0
1
17
I am currently using Skript on my server and I came across this error while programming the keycards

Code:
on right click on "Alpha Only":
    if name of player is "AlphaBeta906":
        send "&aAcsess Accepted!" to player
    else:
        cancel event
        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
 
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.
 
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
 
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
 
Last edited:
  • Like
Reactions: GRRRilla_Ninja
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
 
I guess that skript cannot change that because minecraft behavior.
 
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

Also is it nessisary to get a on click?
 
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
 
Status
Not open for further replies.