thevirtualpotato Posted January 2, 2021 Share Posted January 2, 2021 (edited) I'm very much a beginner at this so please help. I'm trying to make it so that if my gui is closed it opens again. Basically make it so that the gui is unclosable until the very end. This is going to be a setup type of thing where the player must going a clan and select a kit before playing on the survival server. I have looked at other old forums on unclosable guis but nothing seems to work. Maybe its because its an older version? This is what I have so far: Spoiler on join: if {Joins::*} does not contain player's uuid: give player stone sword give player compass give player 16 torch give player crafting table give player oak boat add player's uuid to {Joins::*} set join message to "&7(&a+&7) &b%player%" execute player command "/join" else: set join message to "&7(&a+&7) &r%player%" wait 3 ticks send "&bWelcome back &a%player%&b!&r" on quit: set leave message to "&7(&4-&7) &r%player%" command /join: trigger: open virtual chest inventory with size 5 named "&0Set Up" to player format gui slot 8 of player with paper named "&4&lImportant!" with lore "&c&lDO NOT CLOSE THIS GUI" format gui slot 20 of player with map named "Clans" to run: execute player command "/1" format gui slot 22 of player with iron sword named "Kits" to run: execute player command "/2" format gui slot 24 of player with book named "Receive Books" to run: execute player command "/3" Also I have Skript, SkQuery, and TuSKe. Edited January 2, 2021 by thevirtualpotato Link to comment Share on other sites More sharing options...
colorblindcolin Posted January 2, 2021 Share Posted January 2, 2021 (edited) on inventory close: if name of event-inventory contains "<name here>": cancel event Give that a go Edited January 2, 2021 by iOmega__ –––––––––––––––––––––––––––––––––––––––––––––––––– Please leave a reaction if my assistance was satisfactory! Link to comment Share on other sites More sharing options...
thevirtualpotato Posted January 2, 2021 Author Share Posted January 2, 2021 11 minutes ago, iOmega__ said: on inventory close: if name of event-inventory contains "<name here>": cancel event Give that a go it says that an on inventory close event cannot be cancelled? Link to comment Share on other sites More sharing options...
colorblindcolin Posted January 2, 2021 Share Posted January 2, 2021 (edited) 3 hours ago, thevirtualpotato said: it says that an on inventory close event cannot be cancelled? You can make the GUI into a function, and activate the function when you close it. Example: function openGUI(p: player): open virtual chest inventory with size 5 named "&0Set Up" to {_p} format gui slot 8 of {_p} with paper named "&4&lImportant!" with lore "&c&lDO NOT CLOSE THIS GUI" format gui slot 20 of {_p} with map named "Clans" to run: execute {_p} command "/1" format gui slot 22 of {_p} with iron sword named "Kits" to run: execute {_p} command "/2" format gui slot 24 of {_p} with book named "Receive Books" to run: execute {_p} command "/3" on inventory close: if name of event-inventory contains "&0Set Up": openGUI(player) command /gui: trigger: openGUI(player) Edited January 3, 2021 by iOmega__ 1 –––––––––––––––––––––––––––––––––––––––––––––––––– Please leave a reaction if my assistance was satisfactory! Link to comment Share on other sites More sharing options...
UntitledGoose Posted January 2, 2021 Share Posted January 2, 2021 3 minutes ago, thevirtualpotato said: it says that an on inventory close event cannot be cancelled? They indeed cannot be cancelled. This is an option on inventory close: if name of event-inventory contains "<name here>": open event-inventory to player 1 VIP since January 7th, 2020 Support since September 19th, 2020 Helper since November 3rd, 2020 Moderator since March 8th, 2021 Link to comment Share on other sites More sharing options...
thevirtualpotato Posted January 2, 2021 Author Share Posted January 2, 2021 (edited) 10 minutes ago, TheGoose said: They indeed cannot be cancelled. This is an option on inventory close: if name of event-inventory contains "<name here>": open event-inventory to player ok that kinda worked. When I try to close the inventory it reopens once. then if i try to close it again it closes like normal. it is also saying that the script infinitely (or excessively) repeated itsself. Edited January 2, 2021 by thevirtualpotato Link to comment Share on other sites More sharing options...
colorblindcolin Posted January 2, 2021 Share Posted January 2, 2021 20 minutes ago, thevirtualpotato said: ok that kinda worked. When I try to close the inventory it reopens once. then if i try to close it again it closes like normal. it is also saying that the script infinitely (or excessively) repeated itsself. You can try the function based one I sent. 1 –––––––––––––––––––––––––––––––––––––––––––––––––– Please leave a reaction if my assistance was satisfactory! Link to comment Share on other sites More sharing options...
thevirtualpotato Posted January 2, 2021 Author Share Posted January 2, 2021 1 hour ago, iOmega__ said: You can make the GUI into a function, and activate the function when you close it. Example: function openGUI(p: player): open virtual chest inventory with size 5 named "&0Set Up" to player format gui slot 8 of player with paper named "&4&lImportant!" with lore "&c&lDO NOT CLOSE THIS GUI" format gui slot 20 of player with map named "Clans" to run: execute player command "/1" format gui slot 22 of player with iron sword named "Kits" to run: execute player command "/2" format gui slot 24 of player with book named "Receive Books" to run: execute player command "/3" on inventory close: if name of event-inventory contains "&0Set Up": openGUI(player) command /gui: trigger: openGUI(player) at this point I have no idea what is going on lol it gave me this when i reloaded the script. Link to comment Share on other sites More sharing options...
colorblindcolin Posted January 2, 2021 Share Posted January 2, 2021 3 minutes ago, thevirtualpotato said: at this point I have no idea what is going on lol it gave me this when i reloaded the script. Whoops, forgot to edit the GUI after copy pasting; just change all the parts with "player" to {_p} and it should function. Sorry about that! 1 –––––––––––––––––––––––––––––––––––––––––––––––––– Please leave a reaction if my assistance was satisfactory! Link to comment Share on other sites More sharing options...
thevirtualpotato Posted January 2, 2021 Author Share Posted January 2, 2021 22 minutes ago, iOmega__ said: Whoops, forgot to edit the GUI after copy pasting; just change all the parts with "player" to {_p} and it should function. Sorry about that! im sorry but would you mind writing it out for me? im still missing something apparently... Link to comment Share on other sites More sharing options...
Echology Posted January 3, 2021 Share Posted January 3, 2021 i mean this is my personal opinion but you should use vanilla guis function gui(p:player): set (metadata tag "gui" of {_p}) to chest inventory with 3 rows named "gui" set slot 0 of (metadata tag "gui" of {_p}) to stick named "this is a stick" open (metadata tag "gui" of {_p}) to {_p} on inventory close: event-inventory is (metadata tag "gui" of {_p}): gui(player) command gui: trigger: gui(player) again its your opinion but idk its a good skill to know https://forums.skunity.com/threads/vanilla-guis.8939/ for more info [PATRON] Echology Link to comment Share on other sites More sharing options...
thevirtualpotato Posted January 3, 2021 Author Share Posted January 3, 2021 alright so i figured out how to make it unclosable but now after it reopens the gui is completely blank... Spoiler command /join: trigger: open virtual chest inventory with size 5 named "&0Set Up" to player format gui slot 8 of player with paper named "&4&lImportant!" with lore "&c&lDO NOT CLOSE THIS GUI" format gui slot 20 of player with glowing map named "Clans" to run: execute player command "/1" format gui slot 22 of player with glowing iron sword named "Kits" to run: execute player command "/2" format gui slot 24 of player with glowing book named "Receive Books" to run: execute player command "/3" on inventory close: if name of event-inventory contains "&0Set Up": wait 1 tick open event-inventory to player Link to comment Share on other sites More sharing options...
Echology Posted January 3, 2021 Share Posted January 3, 2021 function gui(p:player): set (metadata tag "gui" of {_p}) to chest inventory with 3 rows named "gui" set slot 0 of (metadata tag "gui" of {_p}) to stick named "this is a stick" open (metadata tag "gui" of {_p}) to {_p} on inventory close: event-inventory's name is "gui": gui(player) on inventory click: event-inventory is (metadata tag "gui" of {_p}): index of event-slot is 0: send "&cYou clicked on da stick" command gui: trigger: gui(player) seems to work for me, I mean you'd have to edit it but I mean for the purposes of an unlosable gui this seems fine. 2 minutes ago, thevirtualpotato said: alright so i figured out how to make it unclosable but now after it reopens the gui is completely blank... Hide contents command /join: trigger: open virtual chest inventory with size 5 named "&0Set Up" to player format gui slot 8 of player with paper named "&4&lImportant!" with lore "&c&lDO NOT CLOSE THIS GUI" format gui slot 20 of player with glowing map named "Clans" to run: execute player command "/1" format gui slot 22 of player with glowing iron sword named "Kits" to run: execute player command "/2" format gui slot 24 of player with glowing book named "Receive Books" to run: execute player command "/3" on inventory close: if name of event-inventory contains "&0Set Up": wait 1 tick open event-inventory to player 1 hour ago, BluBoy3ch0 said: i mean this is my personal opinion but you should use vanilla guis function gui(p:player): set (metadata tag "gui" of {_p}) to chest inventory with 3 rows named "gui" set slot 0 of (metadata tag "gui" of {_p}) to stick named "this is a stick" open (metadata tag "gui" of {_p}) to {_p} on inventory close: event-inventory is (metadata tag "gui" of {_p}): gui(player) command gui: trigger: gui(player) again its your opinion but idk its a good skill to know https://forums.skunity.com/threads/vanilla-guis.8939/ for more info [PATRON] Echology Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now