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.

Crate Inventory / GUI Issues

Discussion in 'Skript' started by Nightmarinya, May 20, 2019.

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

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    +===================================================+
    | Skript Version: bensku-2.3.6
    | Skript Addons: Skellett, SKDragon, SKRayFall, SKQuery, TuSKe
    | Server Version: 1.13.2
    +===================================================+

    Hi there!
    Recently I've been getting back into scripting and wanted to try making a script for custom lootcrates / lootboxes. I've been having some issues with not being able to get things to work or not being able to find solutions for certain things so I figured I'd make a post asking about some of the things I'm having issues with, for me to learn and for any of those having similar issues whilst scripting something. ^^

    Here's a list of the issues I'm currently facing when making the script:
    The script is unable and needs to be able to determine when a certain inventory is closed and:

    » Once closed, it also needs to recognize what the inventory looked like prior to being closed.
    » The script needs to remember what is in the inventory on close so it can do one of two things:


    • On close, if all items inside the GUI are the same as when it first opened, successfully close the GUI and give the player the crate back. (As when you right click with it to open it, it takes it away)


    • On close, if item(s) inside the GUI are not the same as when it first opened, prevent it from closing or reopen the same exact GUI with the same items it had before closing.

    • This would also need to work with items constantly changing within the GUI as when you click on the item IN the GUI (named something like "???" with lore "Click to roll an item!" or whatever you please) it would roll through all the possible items randomly, mainly just as a Dog and Pony Show per se.

    Is there anyone who could potentially help me with these issues?

    Here is the code I could get down before I hit a roadstop, apologies if it's a little messy didn't
    get to the point where I started cleaning it up a bit, usually do that when it's finished ^^

    Code (Skript):
    1.  
    2. command givetestcrate:
    3.     trigger:
    4.         give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
    5.  
    6. on right click with ender chest:
    7.     name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
    8.         wait 1 tick
    9.         play sound "block.ender_chest.open" with volume 100 and pitch 0.75 at player for player
    10.         remove 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" from player's inventory
    11.         open chest with 6 rows named "&lIROTHAI CAVERNS LOOTBOX" to player
    12.         if name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
    13.             wait 1 tick
    14.             format slot 0 of player with ender chest named "&6&l???" with lore "&7Click to roll an item!" to be unstealable
    15.  
    16. on inventory click:
    17.     name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
    18.         name of item is "&6&l???":
    19.             wait 1 tick
    20.             format slot 0 of player with diamond named "&a&lThis works" to be unstealable
    21.         else:
    22.             cancel the event
    23.  
    24.    
    25. on place of ender chest:
    26.     name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
    27.         cancel the event
    28.  
    (No Errors)

    Thank you for your time and any potential help!
    --- Double Post Merged, May 23, 2019, Original Post Date: May 20, 2019 ---
    bump ^^ Still need help with this :c
     
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    Add me on discord: AsuDev#0714
    I will help you the best I can :emoji_slight_smile:
     
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    You should fix stuff on the forums, not via PM, as other people might also want to use the solution.
     
    Runakai likes this.
  4. jonawoning

    jonawoning Member

    Joined:
    May 24, 2019
    Messages:
    29
    Likes Received:
    2
    As here is said, if you want to help him please do it on the forums.
    This can also help others who have the same problem, thanks.
     
  5. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    On one hand, yes, I agree that this should be resolved on the forums page as this could help other people having the same issue learn how to fix it themselves. Especially since I haven't found any other posts with any kind of solution to these issues.

    On the other, I don't think it would be an issue if we talked about it on discord cause if we did and we resolved it than I would just post the solution to it on this post anyways, I wouldn't just abandon it with no answer, even if we couldn't figure it out I'd at least say something.

    Whatever y'all think is best, I'm down for either/or.
    Let me know if we should keep this here, or if we're allowed to continue it in private as long
    as we post our solution(s) here~

    Also thank you for the offer of assistance Revelation and I'd love the help. c:
    --- Double Post Merged, May 24, 2019, Original Post Date: May 24, 2019 ---
    https://gyazo.com/9245d8f25f11a7b85e0b04cb42eb8811

    Here, I linked a gif of something similar to what I'm trying to achieve ^^
    The flickering when opening the crate is me trying to close out of the inventory but it not letting me,
    one of the things I need help figuring out. And the rolling of the items, another thing I need help figuring out.
    As you can see it also remembers what the items in the inventory of the crate was even when I closed out of it and it reopened itself.

    I couldn't find a perfect example of what I'm trying to create that is professionally done like the one in the gif is, but it's very similar to what I'm going for.

    Have you ever seen monthly crates on CosmicPvP factions? Yeah that's essentially what's supposed to be just changed a little~
     
    #5 Nightmarinya, May 24, 2019
    Last edited: May 24, 2019
  6. jonawoning

    jonawoning Member

    Joined:
    May 24, 2019
    Messages:
    29
    Likes Received:
    2
    I know what you want.

    I think you can set more gui's on one command or event, but this will cost you a lot of time.
    If you don't know what i mean, i can make a example code if you want me to.
    --- Double Post Merged, May 24, 2019, Original Post Date: May 24, 2019 ---
    Ah, i found something about crates on spigot.
    This is a skript made plugin, i didn't test it so i don't know if it works.
    But you can steal/take something of this code for the thing what you want.

    Link: https://www.spigotmc.org/resources/simple-crates-skript.48875/
     
    Nightmarinya likes this.
  7. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    Hmm okay thanks! I'll check it out, read through it and let you know if I find anything of use.
    Thanks again! :emoji_slight_smile:
     
    jonawoning likes this.
  8. jonawoning

    jonawoning Member

    Joined:
    May 24, 2019
    Messages:
    29
    Likes Received:
    2
    No problem!

    But there is an problem with the skript, it has an SkQuery GUI system/thing.
    So i don't know if it works with your skript.
    Place a reply if something don't works or anything.

    :emoji_wink:
     
    Nightmarinya likes this.
  9. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    Well did try applying the script to the server and it threw 28 errors, I do have SkQuery so anything related to it should work, unless of course it's an outdated script which it could easily be.

    Anyways I looked into the script a little and the only "on inventory close" event of interest I could find was this one:

    Code (Skript):
    1.  
    2. on inventory close:
    3.     if {Crates.Use.In.%player%} is true:
    4.         set {Crates.Use.X.%player%} to false
    5.         wait 1 tick
    6.         open chest with 3 rows named "&bCrates&8¦&3%{Crates.InUse.%player%}%" to player
    7.         unformat slot 9 of player
    8.         unformat slot 10 of player
    9.         unformat slot 11 of player
    10.         unformat slot 12 of player
    11.         unformat slot 13 of player
    12.         unformat slot 14 of player
    13.         unformat slot 15 of player
    14.         unformat slot 16 of player
    15.         unformat slot 17 of player
    16.         format slot 9 of player with {Crates.Use.%player%.Item.8} to be unstealable
    17.         format slot 10 of player with {Crates.Use.%player%.Item.9} to be unstealable
    18.         format slot 11 of player with {Crates.Use.%player%.Item.1} to be unstealable
    19.         format slot 12 of player with {Crates.Use.%player%.Item.2} to be unstealable
    20.         format slot 13 of player with {Crates.Use.%player%.Item.3} to be unstealable
    21.         format slot 14 of player with {Crates.Use.%player%.Item.4} to be unstealable
    22.         format slot 15 of player with {Crates.Use.%player%.Item.5} to be unstealable
    23.         format slot 16 of player with {Crates.Use.%player%.Item.6} to be unstealable
    24.         format slot 17 of player with {Crates.Use.%player%.Item.7} to be unstealable
    25.         format slot 0 of player with 160:5 named "&a⬛" to be unstealable
    26.         format slot 1 of player with 160:5 named "&a⬛" to be unstealable
    27.         format slot 2 of player with 160:5 named "&a⬛" to be unstealable
    28.         format slot 3 of player with 160:5 named "&a⬛" to be unstealable
    29.         format slot 5 of player with 160:5 named "&a⬛" to be unstealable
    30.         format slot 6 of player with 160:5 named "&a⬛" to be unstealable
    31.         format slot 7 of player with 160:5 named "&a⬛" to be unstealable
    32.         format slot 8 of player with 160:5 named "&a⬛" to be unstealable
    33.  
    34.         format slot 18 of player with 160:5 named "&a⬛" to be unstealable
    35.         format slot 19 of player with 160:5 named "&a⬛" to be unstealable
    36.         format slot 20 of player with 160:5 named "&a⬛" to be unstealable
    37.         format slot 21 of player with 160:5 named "&a⬛" to be unstealable
    38.         format slot 23 of player with 160:5 named "&a⬛" to be unstealable
    39.         format slot 24 of player with 160:5 named "&a⬛" to be unstealable
    40.         format slot 25 of player with 160:5 named "&a⬛" to be unstealable
    41.         format slot 26 of player with 160:5 named "&a⬛" to be unstealable
    42.         play "CLICK" to player at volume 2
    43.         unformat slot 4 of player
    44.         unformat slot 22 of player
    45.         format slot 4 of player with 50 named "&9▼" to be unstealable
    46.         format slot 22 of player with 50 named "&9▲" to be unstealable
    47.         wait 3 tick
    48.         play "ORB_PICKUP" to player at volume 2
    49.         wait 3 tick
    50.         play "ORB_PICKUP" to player at volume 2
    51.         wait 3 tick
    52.         play "ORB_PICKUP" to player at volume 2
    53.         wait 3 tick
    54.         play "NOTE_PLING" to player at volume 2                
    55.         set {Crates.Use.In.%player%} to false
    56.  
    57.         give player {Crates.Use.%player%.Item.3}
    58.  
    I'm not quite sure if this script was able to do the 'reopen on close' thing but if it can, this was the only thing I could find potentially related to it. I'm not the master skript user myself so some of the things written in this script I'm not entirely sure what the purpose is ^^
    Such as the unformatting and reformatting.

    Otherwise I didn't see much in the script I could use for this specific project unless I missed something, thank you anyway :C And thank you again for the help! It really means a lot to me c:
     
    jonawoning likes this.
  10. jonawoning

    jonawoning Member

    Joined:
    May 24, 2019
    Messages:
    29
    Likes Received:
    2
    No problem!
    No Problem!
     
  11. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    This is the only thing I've got working at the moment, I tried messing around with the rolling of the items thing but it didn't end up too well. As in, it didn't work. xc
    I cleaned up the old code I had for the menu though and made it look prettier.
    Learned that I could just use the loop integer thing instead of filling each slot manually =P

    Code (Skript):
    1.  
    2. on right click with ender chest:
    3.     name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
    4.         wait 1 tick
    5.         open chest with 6 rows named "&lIROTHAI CAVERNS LOOTBOX" to player
    6.         wait 1 tick
    7.         play sound "block.ender_chest.open" with volume 100 and pitch 0.75 at player for player
    8.         play sound "entity.firework_rocket.launch" with volume 100 and pitch 1 at player for player
    9.         play sound "entity.player.levelup" with volume 100 and pitch 1 at player for player
    10.         loop integers between 0 and menu size of player's current inventory - 1:
    11.             set slot loop-number of player's current inventory to black stained glass pane named " "
    12.         wait 1 tick
    13.         loop integers between 12 and 15 - 1:
    14.             set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
    15.         loop integers between 21 and 24 - 1:
    16.             set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
    17.         loop integers between 30 and 33 - 1:
    18.             set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
    19.         set slot 49 of player's current inventory to red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to recieve a guaranteed", "&5&lEPIC&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!"
    20.    
    21. on inventory click:
    22.     name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
    23.         cancel the event
    24.    
    25. command lootbox:
    26.     trigger:
    27.         give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
    28.  
     
    #11 Nightmarinya, May 24, 2019
    Last edited: May 25, 2019
  12. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    I always paste the solution on the forum post after helping someone on discord. I really just don't like a million back and forths especially with larger pieces of code. Still open to help with this if you need still it.
     
  13. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    I understand that, but the process of fixing something can also help people. If people see how problems are solved, they will be better at solving their own problems in the future.
     
  14. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    Makes sense I guess. But yea, I still am going to offer discord help for this kind of stuff if they want help. They can accept or they don't accept.
     
  15. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    Apologies for not responding to this thread for a while, I ended up going to sleep after my last post.

    I do agree with TPGames, I've had lots of moments where I looked up how to do something, and got answered based off of the process of fixing the issue, and not the actual solution that the person who made the thread wanted.

    I really do appreciate the offer Revelation and I can understand not wanting to deal with back and forths on forum pages.
    But, since the post is already made and is here it might as well have the solutions be posted here.

    I definitely don't mind talking to you at some point though if there are any more issues I come across, if you're still up for it.
    What I could do in the future if you help me is just make a thread about the issue I was having and respond to myself with the solutions that we
    went through to try and fix it, and then the solution that did fix it, kind of like a, "this was the issue, here's the solutions" kind of post, if that's allowed. I'm not sure if that kind of stuff is or isn't allowed, (posting and responding to myself about the solutions I mean) so if someone experienced with the forums community, probably someone like TPGames, could let me know that would be awesome, thank you~ :emoji_slight_smile:

    Also one other thing I don't know if you're up for it but if we talked Revelation I'd likely add you to a public discord group I made for my friends and steam group members, it's still relatively small, but there is a Semi-Private channel we could discuss the coding and stuff in that only staff are allowed to see, and they won't likely bother us while we're talking unless they need to. Mainly just because I'm not a huge fan of talking to people I've just met in completely private areas (no offense I hope you understand what I mean though :c) but we could for sure talk in that semi-private channel I have in the server if you're interested ^^ Let me know if that's alright with you, maybe we could work together on some stuff at some point help each other out on scripts and stuff ^^ although I'm fairly certain that you know a lot more about skript than I do and most of the stuff I know you probably already know haha cx
     
    #15 Nightmarinya, May 25, 2019
    Last edited: May 25, 2019
  16. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    It is allowed to post your own solution to your thread, since any solution is better than none (most of the time). It's also allowed to solve things with someone else helping you over Discord, but it's better to post all of the fixing stuff here, since others will also be able to appreciate it. So all of it is basically allowed, but posting here is just better for other people.
     
  17. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    Right~ As I said if we did do that in the future I'd post all of the "test solutions" and fixes in the post.
    Everything that's related to the code, essentially.

    Also still need assistance on these problems if anyone knows how to help with them ^^
    If not I'll talk to Revelation about them on discord and post anything code related or anything that sounds like it could help other people to the post. But as I said, since the post was made it might as well have the solution written here, if anyone knows it~
     
  18. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    You can use https://skriptlang.github.io/Skript/events.html#inventory_close, then probably event-inventory and https://skriptlang.github.io/Skript/expressions.html#ExprItemsIn with event-inventory. You can also check the name of the current inventory of the player (https://skriptlang.github.io/Skript/expressions.html#ExprOpenedInventory) to check if they still have the inventory open.
     
  19. Nightmarinya

    Nightmarinya Member

    Joined:
    Oct 2, 2018
    Messages:
    31
    Likes Received:
    4
    Okay that's one of the issues down! Thank you! :emoji_slight_smile:

    Here's what I used:

    Code (Skript):
    1.  
    2. on inventory close:
    3.     name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
    4.         loop all items in player's current inventory:
    5.             slot 12, 13, 14, 21, 22, 23, 30, 31 and 32 of player's current inventory is ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
    6.                 give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
    7.                 stop
    8.  
    I should also be able to make it determine whether or not the items in the inventory are NOT the same and make it do stuff with the same method.
    Now the only issues left are:

    - Items need to roll (tried doing it myself but it didn't work :/ kind of got all glitchy actually.)
    - And closed inventory needs to be reopened, I'm fairly certain trying to put a "cancel the event" on a "on inventory close" event won't work but I'll try it anyways ^^

    Thanks for all the help ^-^

    EDIT: Yup as I suspected "on inventory close" events can't be cancelled, worth a try at least
     
    #19 Nightmarinya, May 25, 2019
    Last edited: May 25, 2019
  20. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    What do you meaning with `roll`?

    You can try to re-open the menu on inventory close (do wait a tick). You can re-open it with `open event-inventory to player`
     
Thread Status:
Not open for further replies.

Share This Page

Loading...