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 NPC Open empty gui with item in hand

Discussion in 'Skript' started by DKPeak, Feb 26, 2021.

  1. DKPeak

    DKPeak New Member

    Joined:
    Feb 1, 2017
    Messages:
    5
    Likes Received:
    0
    Hi

    I have a GUI that is suposed to open when you righclick on a NPC. But when you rightclick on the NPC with any item, it just opens a empty GUI, but if you just rightclick with your hand, it does it right.

    Video:


    I have tried to use "on right click on entity:" and the plugin commandNPC, but both is doing the same problem.

    The code:
    Code (Text):
    1.  
    2. command /mission:
    3.     trigger:
    4.             set {_celle1} to placeholder "quests_player_has_completed_quest_celle1"
    5.             set {_celle2} to placeholder "quests_player_has_completed_quest_celle2"
    6.             set {_celle4} to placeholder "quests_player_has_completed_quest_celle4"
    7.             set {_celle5} to placeholder "quests_player_has_completed_quest_celle5"
    8.             set {_celle6} to placeholder "quests_player_has_completed_quest_celle6"
    9.             set {_celle7} to placeholder "quests_player_has_completed_quest_celle7"
    10.  
    11.             open chest with 5 rows named "&c&lCELLE CARL" to player
    12.             set slot 0, 2, 4, 6, 8, 36, 40, 38, 42 and 44 of player's current inventory to shiny black glass pane named " "
    13.             set slot 1, 3, 5, 7, 37, 39, 41 and 43 of player's current inventory to shiny red glass pane named " "    
    14.             if {_celle1} = "true":
    15.                 set slot 19 of player's current inventory to shiny crafting table named "&e&l[!] &5&lCRAFTING &e&l[!]" with lore "||&b&lMål|| &8- &7Craft et crafting table||||&dStatus&8: &aHar klaret"
    16.             else:
    17.                 set slot 19 of player's current inventory to crafting table named "&e&l[!] &5&lCRAFTING &e&l[!]" with lore "||&b&lMål|| &8- &7Craft et crafting table||||&dStatus&8: &cHar ikke klaret"
    18.          
    19.             if {_celle2} = "true":
    20.                 set slot 20 of player's current inventory to shiny non-burning_furnace named "&e&l[!] &c&lEN VARM OVN &e&l[!]" with lore "||&b&lMål|| &8- &7Craft en ovn|| &8- &7Smelt 64 sten||||&b&lKrav|| &8- &7Crafting Mission||||&dStatus&8: &aHar klaret"
    21.             else:
    22.                 set slot 20 of player's current inventory to non-burning_furnace named "&e&l[!] &c&lEN VARM OVN &e&l[!]" with lore "||&b&lMål|| &8- &7Craft en ovn|| &8- &7Smelt 64 sten||||&b&lKrav|| &8- &7Crafting Mission||||&dStatus&8: &cHar ikke klaret"
    23.  
    24.             if {_celle3} = "true":
    25.                 set slot 21 of player's current inventory to shiny stone brick named "&e&l[!] &a&lDEKORATØR &e&l[!]" with lore "||&b&lMål|| &8- &7Craft 16 stone brick||||&b&lKrav|| &8- &7En varm ovn Mission||||&dStatus&8: &aHar klaret"
    26.             else:
    27.                 set slot 21 of player's current inventory to stone brick named "&e&l[!] &a&lDEKORATØR &e&l[!]" with lore "||&b&lMål|| &8- &7Craft 16 stone brick||||&b&lKrav|| &8- &7En varm ovn Mission||||&dStatus&8: &cHar ikke klaret"
    28.  
    29.             if {_celle4} = "true":
    30.                 set slot 22 of player's current inventory to shiny anvil named "&e&l[!] &9&lREPARATØR &e&l[!]" with lore "||&b&lMål|| &8- &7Craft en anvil||||&b&lKrav|| &8- &7Crafting Mission||||&dStatus&8: &aHar klaret"
    31.             else:
    32.                 set slot 22 of player's current inventory to anvil named "&e&l[!] &9&lREPARATØR &e&l[!]" with lore "||&b&lMål|| &8- &7Craft en anvil||||&b&lKrav|| &8- &7Crafting Mission||||&dStatus&8: &cHar ikke klaret"
    33.  
    34.             if {_celle5} = "true":
    35.                 set slot 23 of player's current inventory to shiny bread named "&e&l[!] &d&lBAGER &e&l[!]" with lore "||&b&lMål|| &8- &7Craft 8 brød||||&dStatus&8: &aHar klaret"
    36.             else:
    37.                 set slot 23 of player's current inventory to bread named "&e&l[!] &d&lBAGER &e&l[!]" with lore "||&b&lMål|| &8- &7Craft 8 brød||||&dStatus&8: &cHar ikke klaret"
    38.  
    39.             if {_celle6} = "true":
    40.                 set slot 24 of player's current inventory to shiny soul sand named "&e&l[!] &4&lULOVLIG BORGER &e&l[!]" with lore "||&b&lMål|| &8- &7Sæt 12 soul sand||||&dStatus&8: &aHar klaret"
    41.             else:
    42.                 set slot 24 of player's current inventory to soul sand named "&e&l[!] &4&lULOVLIG BORGER &e&l[!]" with lore "||&b&lMål|| &8- &7Sæt 12 soul sand||||&dStatus&8: &cHar ikke klaret"
    43.  
    44.             if {_celle7} = "true":
    45.                 set slot 25 of player's current inventory to shiny diamond sword named "&e&l[!] &b&lFIND PVP LONE &e&l[!]" with lore "||&b&lMål|| &8- &7Find PvP Lone||||&dStatus&8: &aHar klaret"
    46.             else:
    47.                 set slot 25 of player's current inventory to diamond sword named "&e&l[!] &b&lFIND PVP LONE &e&l[!]" with lore "||&b&lMål|| &8- &7Find PvP Lone||||&dStatus&8: &cHar ikke klaret"
    48.  
    Thank you
    --- Double Post Merged, Feb 26, 2021, Original Post Date: Feb 26, 2021 ---
    So, i found the problem with some help.
    I forgot to add "wait a tick" between the inventory opening and the menu being set
     
    #1 DKPeak, Feb 26, 2021
    Last edited: Feb 26, 2021
  2. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    192
    Likes Received:
    18
    mark your thread as solved then
     

Share This Page

Loading...