Double post = Quand on met deux posts d'affilés
Je vois pas comment faire pour savoir quand un joueur met un item dans un gui.
Si quelqu'un le sait, il suffit de le détecter et de mettre "add event-item to {PORTEMONNAIE.%player%::*}"
command /portemonnaie:
trigger:
loop player's inventory:
if loop-value is a diamond named "&bPorte monnaie":
set {_INV} to true
if {_INV} is not set:
give 1 diamond named "&bPorte monnaie" to player
function TAKEITEM(item: itemstack, slot: number, p: player):
give 1 {_item} to {_p}
unformat the gui slot {_SLOT} of {_p}
remove {_item} from {PORTEMONNAIE.%{_p}%::*}
on rightclick with diamond:
if player is holding a diamond named "&bPorte monnaie":
open virtual chest inventory with size 1 named "&bPorte monnaie" to player
set {_SLOT} to 0
loop {PORTEMONNAIE.%player%::*}:
format gui slot {_SLOT} of player with loop-value to run function TAKEITEM(loop-value, {_SLOT}, player)
set {DEPOT.%player%} to true
on inventory close:
if {DEPOT.%player%} is true:
clear {DEPOT.%player%}
Ce code il est donc incomplet et ne marche pas