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 our 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 Items from GUI showing in chest

Discussion in 'Skript' started by kevine2408, Feb 9, 2020.

  1. kevine2408

    kevine2408 Member

    Joined:
    Feb 9, 2020
    Messages:
    1
    Likes Received:
    0
    Hey SkUnity people :emoji_grinning: i made a skript when you rightclick an emerald a GUI opens up
    and the problem is when i rightclick it works fine but when i hold the emerald in my hand and rightclick on a chest, hopper, enderchest etc the items from the gui appear in there and than you can simply duplicate them how can i fix this?


    Skript Version:
    Skript 2.2
    Minecraft Version: 1.8.8
    ---
    Full Code:
    on rightclick holding emerald:

    loop all items in the inventory of player:

    if loop-item's name is "§8➥ &c----":

    set {remove-item.%player%} to loop-item

    set {item-back.%player%} to "true"

    open chest with 3 rows named "&7&l------§a§lTauschbörse&7&l------" to player

    wait 1 tick

    format slot 0 of player with 1 black glass named "§8§m---" to be unstealable

    format slot 1 of player with 1 black glass named "§8§m---" to be unstealable

    Not 100% full code dont want to show it .-.


    Errors on Reload:

    none


    Addons using (including versions):
    SkQuery, TuSKe, skRayFall,


    Troubleshooting:

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
    --- Double Post Merged, Feb 11, 2020 at 5:08 PM, Original Post Date: Feb 9, 2020 ---
    Just a quick replay i got help on the discord just needet to add cancel event 1 line before i open a virtual chest :emoji_slight_smile:
     
  2. ghoul_matt

    ghoul_matt Member

    Joined:
    Jan 9, 2020
    Messages:
    4
    Likes Received:
    0
    add "if event-block is chest or hopper or enderchest:" after the event, to just stop, and a "else" section to continue the skript
     
  3. Govindas

    Govindas Well-Known Member

    Joined:
    Feb 5, 2017
    Messages:
    75
    Likes Received:
    4
    some recommendations:
    1. use list variables
    2. use BOOLEANS instead of STRINGS, so not "true", but just true, it takes much less space to save a boolean than a string in your memory
    3. use vanilla guis, what you are using is skquery guis which are not recommended, they are buggy, slow and lack features. tutorial: https://forums.skunity.com/threads/vanilla-guis.8939/
     
Loading...