#Skript Gui
1 messages · Page 1 of 1 (latest)
I don't recommend using Skript-GUI for this.
What you can do is simply define a function to open the GUI:
set {_gui} to chest inventory with 6 rows named "AAA"
set slot (integers between 0 and 54) of {_gui} to black stained glass pane named "&0" # This sets the background. You can set the background to anything.
set slot 0 of {_gui} to barrier named "wawa" with lore "wawa 2" and "wawa 3" # Item with lore.
open {_gui} to {_p}```
And then have an inventory click detector:
name of event-inventory contains "AAA"
if player's cursor slot is set:
if name of player's cursor slot is "AAA":
add 1 to {player::%player%::testvariable}
if index of event-slot is 0: # Detects when you click on the first slot.```
The issue with Skript-GUI is that the on close function doesn't work if a cheater has a silent inventory close feature.
So it's best to add the variables as they are placed into the GUI.
I coded something like this for my own server.
My suggestion is to make it so the inventory can't be modified after an item is placed into it to prevent items from being removed from it. If they can remove items, that means every time they take an item from it, it can be used again.
Yep, that'll happen.