Salut,
J'utilise ceci sur mon serveur, je t'invite à changer les variables que tu veux, mais de surtout garder les protections comme "duplication.%player%" car sinon le joueur pourrait dupliquer 😉
Je t'ai laissé le code pour avoir le /chestadmin afin de te permettre d'éditer le coffre d'un joueur.
on inventory close:
if {bank.%player%} is set:
clear {duplication.%player%}
set {bank::%{bank.%player%}%::%player%} to event-inventory's serialized contents
clear {bank.%player%}
message "&aSauvegarde terminé !"
if {admin.bank.%player%} is set:
clear {duplication.%player%}
set {bank::%{admin.bank.%player%}%::%{admin.joueur.%player%}%} to event-inventory's serialized contents
clear {admin.bank.%player%}
message "&aSauvegarde terminé !"
function openbank(p: offline player, type: text):
{_type} is "1":
set {_inv} to chest with 6 rows named "&fJoueur"
if {duplication.%{_p}%} is not set:
set {duplication.%{_p}%} to 1
message "&fDévérouillage en cours de votre bank..." to {_p}
set {_inv}'s serialized contents to {bank::%{_type}%::%{_p}%}
wait 2 ticks
open {_inv} to {_p}
set {bank.%{_p}%} to "%{_type}%"
function openbankadmin(p: player, joueur: offline player, type: text):
{_type} is "1":
set {_inv} to chest with 6 rows named "&fJoueur"
if {duplication.%{_p}%} is not set:
set {duplication.%{_p}%} to 1
message "&fDévérouillage en cours de la bank de &c%{_joueur}%" to {_p}
set {_inv}'s serialized contents to {bank::%{_type}%::%{_joueur}%}
wait 1 tick
open {_inv} to {_p}
set {admin.bank.%{_p}%} to "%{_type}%"
set {admin.joueur.%{_p}%} to "%{_joueur}%"
command /chestadmin1 [<offline player>]:
permission: admin.use
permission message: &cVous n'avez pas la permission.
trigger:
if player has permission "admin.use":
openbankadmin(player, arg-1, "1")
command /chestadmin [<offline player>]:
permission: admin.use
permission message: &cVous n'avez pas la permission.
trigger:
if player has permission "admin.use":
open chest with 1 rows named "&cBank - %arg-1%" to player
make a gui slot 0 of player with 1 chest named "&bBank &7➜ &cNuméro 1" with lore "||&cClique-ici pour ouvrir" to close then run player command "/bank1admin1 %arg-1%"
command /chest:
trigger:
clear {duplication.%player%}
open chest with 1 rows named "&cBank" to player
if player has permission "bank.use":
make a gui slot 0 of player with chest named "&bBank &7➜ &cNuméro 1 &7➜ &fJoueur" with lore "||&cClique-ici pour ouvrir" to close then run player command "/chest1"
else:
make a gui slot 0 of player with chest named "&bBank &7➜ &cNuméro 1 &7➜ &fJoueur" with lore "||&cVous devez acheter la bank" to close then run player command "/shop permission"
command /chest1:
permission: bank.use
permission message: &cVous n'avez pas la permission.
trigger:
openbank(player, "1")
on disconnect:
clear {bank.%player%}
Bonne journée 🙂