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.

Right click on villager

Discussion in 'Skript' started by zaved, Sep 19, 2022.

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

    zaved Member

    Joined:
    Sep 19, 2022
    Messages:
    12
    Likes Received:
    0
    hey,

    first of all I want to explain, that I want to have a villager with the name "Kits" and when you rightclick on the villager, it should open an gui where you can buy some kits.

    Now I tried something but it stopped me already at the point, of opening a gui. It it just opening the standard villager gui, you have in vanilla

    Can somebody help me?

    Code (Text):
    1. on right click on villager:
    2.     if display name of clicked entity is "&8» &6&lKits":
    3.         open chest with 3 rows named "&8» &cConfirmation" to player  
    4.         format slot 0 of player with gray stained glass pane named "&8-/-" to be unstealable
    5.         format slot 1 of player with gray stained glass pane named "&8-/-" to be unstealable
    6.         format slot 2 of player with gray stained glass pane named "&8-/-" to be unstealable
    7.         format slot 3 of player with gray stained glass pane named "&8-/-" to be unstealable
    8.         format slot 4 of player with gray stained glass pane named "&8-/-" to be unstealable
    9.         format slot 5 of player with gray stained glass pane named "&8-/-" to be unstealable
    10.         format slot 6 of player with gray stained glass pane named "&8-/-" to be unstealable
    11.         format slot 7 of player with gray stained glass pane named "&8-/-" to be unstealable
    12.         format slot 8 of player with gray stained glass pane named "&8-/-" to be unstealable
    13.         format slot 18 of player with gray stained glass pane named "&8-/-" to be unstealable
    14.         format slot 19 of player with gray stained glass pane named "&8-/-" to be unstealable
    15.         format slot 20 of player with gray stained glass pane named "&8-/-" to be unstealable
    16.         format slot 21 of player with gray stained glass pane named "&8-/-" to be unstealable
    17.         format slot 22 of player with gray stained glass pane named "&8-/-" to be unstealable
    18.         format slot 23 of player with gray stained glass pane named "&8-/-" to be unstealable
    19.         format slot 24 of player with gray stained glass pane named "&8-/-" to be unstealable
    20.         format slot 25 of player with gray stained glass pane named "&8-/-" to be unstealable
    21.         format slot 26 of player with gray stained glass pane named "&8-/-" to be unstealable
    22.         format slot 17 of player with gray stained glass pane named "&8-/-" to be unstealable
    23.         format slot 8 of player with gray stained glass pane named "&8-/-" to be unstealable
    24.         format slot 9 of player with gray stained glass pane named "&8-/-" to be unstealable
    25.         format slot 14 of player with gray stained glass pane named "&8-/-" to be unstealable
    26.         format slot 18 of player with gray stained glass pane named "&8-/-" to be unstealable
    27.         format slot 12 of player with gray stained glass pane named "&8-/-" to be unstealable
    28.         format slot 12 of player with gray stained glass pane named "&8-/-" to be unstealable
     
  2. GravityImpulse

    Joined:
    Sep 19, 2022
    Messages:
    2
    Likes Received:
    0
    Before opening chest inventory just add cancel event line. And you should probably loop integers from 0 to 26 and there format loop-value slot instead of repeating same code so many times
     
  3. Sabified

    Sabified Member

    Joined:
    Jun 5, 2022
    Messages:
    30
    Likes Received:
    2
    Code (Text):
    1. on right click on villager:
    2.     if display name of clicked entity is "&8» &6&lKits":
    3.         cancel event
    4.  
    5.         open chest with 3 rows named "&8» &cConfirmation" to player
    6.         format slot 0 of player with gray stained glass pane named "&8-/-" to be unstealable
    7.         format slot 1 of player with gray stained glass pane named "&8-/-" to be unstealable
    8.         format slot 2 of player with gray stained glass pane named "&8-/-" to be unstealable
    9.         format slot 3 of player with gray stained glass pane named "&8-/-" to be unstealable
    10.         format slot 4 of player with gray stained glass pane named "&8-/-" to be unstealable
    11.         format slot 5 of player with gray stained glass pane named "&8-/-" to be unstealable
    12.         format slot 6 of player with gray stained glass pane named "&8-/-" to be unstealable
    13.         format slot 7 of player with gray stained glass pane named "&8-/-" to be unstealable
    14.         format slot 8 of player with gray stained glass pane named "&8-/-" to be unstealable
    15.         format slot 9 of player with gray stained glass pane named "&8-/-" to be unstealable
    16.         format slot 12 of player with gray stained glass pane named "&8-/-" to be unstealable
    17.         format slot 14 of player with gray stained glass pane named "&8-/-" to be unstealable
    18.         format slot 18 of player with gray stained glass pane named "&8-/-" to be unstealable
    19.         format slot 19 of player with gray stained glass pane named "&8-/-" to be unstealable
    20.         format slot 20 of player with gray stained glass pane named "&8-/-" to be unstealable
    21.         format slot 21 of player with gray stained glass pane named "&8-/-" to be unstealable
    22.         format slot 22 of player with gray stained glass pane named "&8-/-" to be unstealable
    23.         format slot 23 of player with gray stained glass pane named "&8-/-" to be unstealable
    24.         format slot 24 of player with gray stained glass pane named "&8-/-" to be unstealable
    25.         format slot 25 of player with gray stained glass pane named "&8-/-" to be unstealable
    26.         format slot 26 of player with gray stained glass pane named "&8-/-" to be unstealable
    27.         format slot 17 of player with gray stained glass pane named "&8-/-" to be unstealable
    You need to cancel the interaction of the villager
    Easy fix is
    Code (Text):
    1. cancel event
     
Thread Status:
Not open for further replies.

Share This Page

Loading...