+===================================================+
| 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 ^^
(No Errors)
Thank you for your time and any potential help!
[doublepost=1558581553,1558335000][/doublepost]bump ^^ Still need help with this :c
| 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_language.skript:
command givetestcrate:
trigger:
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
on right click with ender chest:
name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
wait 1 tick
play sound "block.ender_chest.open" with volume 100 and pitch 0.75 at player for player
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
open chest with 6 rows named "&lIROTHAI CAVERNS LOOTBOX" to player
if name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
wait 1 tick
format slot 0 of player with ender chest named "&6&l???" with lore "&7Click to roll an item!" to be unstealable
on inventory click:
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
name of item is "&6&l???":
wait 1 tick
format slot 0 of player with diamond named "&a&lThis works" to be unstealable
else:
cancel the event
on place of ender chest:
name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
cancel the event
(No Errors)
Thank you for your time and any potential help!
[doublepost=1558581553,1558335000][/doublepost]bump ^^ Still need help with this :c