Solved Can't close villager trade menu.

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

krainser

Member
Jan 27, 2017
60
3
3
34
Argentina
Skript Version: 2.2-dev23
Skript Author: Bensku
Minecraft Version: 1.10.2
------
Full Code:

code_language.skript:
on rightclick on a blacksmith:
    loop {BK.Puertos::*}:
        if the display name of the target entity is coloured "&f&lMENU - %loop-value%":
            close player's inventory #<- I think the issue is here
            send player title "" with subtitle "&dCaptain %player%!" for 1 second
            wait 1 second
            send player title "" with subtitle "&7How was your day?" for 1 second
            wait 1 second
            make player execute command "/menu1 %loop-value%"

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
 
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?
 
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?
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!
 
Status
Not open for further replies.