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:
Thank you
[doublepost=1614343949,1614329298][/doublepost]So, i found the problem with some help.
I forgot to add "wait a tick" between the inventory opening and the menu being set
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:
command /mission:
trigger:
set {_celle1} to placeholder "quests_player_has_completed_quest_celle1"
set {_celle2} to placeholder "quests_player_has_completed_quest_celle2"
set {_celle4} to placeholder "quests_player_has_completed_quest_celle4"
set {_celle5} to placeholder "quests_player_has_completed_quest_celle5"
set {_celle6} to placeholder "quests_player_has_completed_quest_celle6"
set {_celle7} to placeholder "quests_player_has_completed_quest_celle7"
open chest with 5 rows named "&c&lCELLE CARL" to player
set slot 0, 2, 4, 6, 8, 36, 40, 38, 42 and 44 of player's current inventory to shiny black glass pane named " "
set slot 1, 3, 5, 7, 37, 39, 41 and 43 of player's current inventory to shiny red glass pane named " "
if {_celle1} = "true":
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"
else:
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"
if {_celle2} = "true":
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"
else:
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"
if {_celle3} = "true":
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"
else:
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"
if {_celle4} = "true":
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"
else:
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"
if {_celle5} = "true":
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"
else:
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"
if {_celle6} = "true":
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"
else:
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"
if {_celle7} = "true":
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"
else:
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"
Thank you
[doublepost=1614343949,1614329298][/doublepost]So, i found the problem with some help.
I forgot to add "wait a tick" between the inventory opening and the menu being set
Last edited: