Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.
command /mail [<p: offline player>]:
trigger:
if {_p} is set:
if metadata tag "mailGUI" of {_p} is not set:
set metadata tag "mailGUI" of {_p} to chest inventory with 6 rows
open (metadata tag "mailGUI" of {_p}) to player
else:
if metadata tag "mailGUI" of player is not set:
set metadata tag "mailGUI" of player to chest inventory with 6 rows
open (metadata tag "mailGUI" of player) to player
on inventory click:
#send "&2Debug"
loop all players:
if player is not loop-player:
if event-inventory is metadata tag "mailGUI" of loop-player:
#loop all players:
#if type of event-slot is {itemslot::%loop-player%}:
# cancel event
if {uncl::%loop-player%::%index of event-slot%} is not set:
send "&4Permanently gave the item away. &3If you would like to retrieve it back, take it before the other party does."
#set {itemslot::%player%} to index of event-slot
set {uncl::%loop-player%::%index of event-slot%} to player
cancel event
else:
if {uncl::%loop-player%::%index of event-slot%} isn't player:
cancel event
else:
delete {uncl::%loop-player%::%index of event-slot%}
else:
loop all players:
if index of event-slot is {itemslot::%loop-player-2%}:
delete {itemslot::%loop-player-2%}