Aller au contenu
  • 0

capture l'inventaire


Question

Posté(e)

bonjour tout le monde

 

est ce que il y a un moyen de capturer l'uinventaire du joueur dans une variable

 

ce que je veux faire:

 

toutes les 5 secondes l'inventaire des joueurs est sauvegarder dans le monde allez et que quand il revien au hub ca clear son inventaire mais quand il revien dans allez il a son inventaire d'avant avec son stuff de pvpfac

15 réponses à cette question

Messages recommandés

  • 0
Posté(e)

C'est très simple a faire, :

capturer:

 

set {_count} to 0
               loop 36 times:
                   set {inv.%{_count}%.main.%arg 1%} to slot {_count} of player's inventory
                   add 1 to {_count}
               set {inv.casque.main.%arg 1%} to player's helmet
               set {inv.ventre.main.%arg 1%} to player's chestplate
               set {inv.jambes.main.%arg 1%} to player's leggings
               set {inv.pieds.main.%arg 1%} to player's boots
               clear player's inventory
               add arg 1 to {list.kit::*}
               message "<green>[<light green>KIT<green>] <white>Vous avez cree le kit %arg 1%"
           else:
               message "<green>[<light green>KIT<green>] <white>Ce kit existe déjà !"

 

mettre le stuff:

 

set {_count} to 0
       loop 36 times:
           set slot {_count} of player's inventory to {inv.%{_count}%.main.%arg 1%}
           add 1 to {_count}
       set the helmet of player to {inv.casque.main.%arg 1%}
       set the chestplate of player to {inv.ventre.main.%arg 1%}
       set the leggings of player to {inv.jambes.main.%arg 1%}
       set the boots of player to {inv.pieds.main.%arg 1%}

  • 0
Posté(e)

Bonsoir,

J'ai un bout de code tous prêt a toi de l’adapter ...

command /invsee <offlineplayer>:
   trigger:
       if player has permission "invsee.view":
           set {_inv} to serialized contents of arg 1's inventory
           set {_helmet} to helmet of arg 1
           set {_chestplate} to chestplate of arg 1
           set {_leggings} to leggings of arg 1
           set {_boots} to boots of arg 1
           open chest with 6 rows named "%arg 1%" to player
           wait 1 tick
           set player's current inventory's serialized contents to {_inv}
           format slot 45 of player with {_helmet} to be unstealable
           unformat slot 45 of player
           format slot 46 of player with {_chestplate} to be unstealable
           unformat slot 46 of player
           format slot 47 of player with {_leggings} to be unstealable
           unformat slot 47 of player
           format slot 48 of player with {_boots} to be unstealable
           unformat slot 48 of player
           loop 54 times:
               if loop-number - 1 is 36,37,38,39,40,41,42,43 or 44:
                   format slot loop-number - 1 of player with black glass named " " to be unstealable

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.