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 Can't close villager trade menu.

Discussion in 'Skript' started by krainser, Mar 2, 2017.

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

    krainser Member

    Joined:
    Jan 27, 2017
    Messages:
    60
    Likes Received:
    3
    Skript Version: 2.2-dev23
    Skript Author: Bensku
    Minecraft Version: 1.10.2
    ------
    Full Code:

    Code (Skript):
    1.  
    2. on rightclick on a blacksmith:
    3.     loop {BK.Puertos::*}:
    4.         if the display name of the target entity is coloured "&f&lMENU - %loop-value%":
    5.             close player's inventory #<- I think the issue is here
    6.             send player title "" with subtitle "&dCaptain %player%!" for 1 second
    7.             wait 1 second
    8.             send player title "" with subtitle "&7How was your day?" for 1 second
    9.             wait 1 second
    10.             make player execute command "/menu1 %loop-value%"
    11.  
    Errors on Reload: No errors


    Console Errors: No errors

    Other Useful Info: The tittles and the -execute command- effects works perfectly, nothing more... I cant cancel the opening of the trade.

    Addons using :
    skRayFall 1.9.7 , SkQuery 1.10 , TuSKe 1.7.2

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
    What other methods have you tried to fix it? Already tried with "cancel event", "close clicked entities's inventory"

    Thanks for reading
     
  2. Best Answer:
    Post #2 by ShaneBee, Mar 3, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    It may be because the menu isn't open yet when they right click; have you tried just adding a "wait 1 tick" at the start?
     
    • Agree Agree x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    It's works! i'll mark the post as solved, but, is anyway to dont show the trade?, right now it appears and close. I would like to dont make it appears. Thanks Simba!
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Does using "cancel event" not work?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    No, it doesnt
     
Thread Status:
Not open for further replies.

Share This Page

Loading...