Bonjour à tous,
Je suis actuellement en train de créer un serveur training mais j'aurais besoin d'aide pour charger un kit via une feuille de papier.
Je m'explique :
J'ai réussi avec un skript, a sauvegarder et charger son kit en cliquant sur un panneau.
[spoiler=Code]
options:
# --> [POTIONS] <--
Nom stuff: &e&oStuff
# --> [ENCHANTEMENT] <--
epee: Sharpness 3 #Mettez "rien" si aucun enchant
arc: Power 5 #Mettez "rien" si aucun enchant
Casque: Protection 2 #Mettez "rien" si aucun enchant
chestplate: Protection 2 #Mettez "rien" si aucun enchant
leggings: Protection 2 #Mettez "rien" si aucun enchant
boots: Protection 2 #Mettez "rien" si aucun enchant
# --> [colorSIGNS] <--
on sign change:
if player has permission "sign.color":
set line 1 to coloured line 1
set line 2 to coloured line 2
set line 3 to coloured line 3
set line 4 to coloured line 4
on sign change:
line 1 is "&7[&6Kit&7]"
player doesn't have permission "sign.place"
cancel event
send "&cVous ne pouvez pas faire celà."
# --> [KITS] <--
on right click on sign:
if line 3 is "&aLe kit":
if line 2 is "&aSauvegarder":
wait 0.5 tick
set {_slot} to 0
loop 36 times:
set {Kit.%player%.%line 3%.%{_slot}%} to slot {_slot} of player's inventory
add 1 to {_slot}
wait 0.5 tick
set {helmet.%player%.%line 3%} to helmet of player
wait 0.5 tick
set {chestplate.%player%.%line 3%} to chestplate of player
wait 0.5 tick
set {leggings.%player%.%line 3%} to leggings of player
wait 0.5 tick
set {boots.%player%.%line 3%} to boots of player
send "&aVotre kit a été sauvegarder."
if line 2 is "&aCharger":
# Copier pour autre panneau restaure mais modifier le "1 "
if line 3 is set:
wait 0.5 tick
set helmet of player to {helmet.%player%.%line 3%}
wait 0.5 tick
set chestplate of player to {chestplate.%player%.%line 3%}
wait 0.5 tick
set leggings of player to {leggings.%player%.%line 3%}
wait 0.5 tick
set boots of player to {boots.%player%.%line 3%}
wait 0.5 tick
set {_slot} to 0
wait 0.5 tick
loop 36 times:
set slot {_slot} of player's inventory to {Kit.%player%.%line 3%.%{_slot}%}
add 1 to {_slot}
send "&aKit reçu !"
on right click on chest:
loop blocks in radius 3 around event-block:
line 2 of loop-block is "{@Nom stuff}"
cancel event
open chest with 5 row named "" to player
wait 1 tick
set {casque} to "{@Casque}"
set {chestplate} to "{@chestplate}"
set {leggings} to "{@leggings}"
set {boots} to "{@boots}"
set {epee} to "{@epee}"
set {arc} to "{@arc}"
format slot 0 of player with diamond helmet of {@Casque} to run [give player diamond helmet of {@Casque}]
format slot 9 of player with diamond chestplate of {@chestplate} to run [give player diamond chestplate of {@chestplate}]
format slot 18 of player with diamond leggings of {@leggings} to run [give player diamond leggings of {@leggings}]
format slot 27 of player with diamond boots of {@boots} to run [give player diamond boots of {@boots}]
format slot 36 of player with diamond sword of {@epee} to run [give player diamond sword of {@epee}]
format slot 1 of player with bow of {@arc} to run [give player bow of {@arc}]
format slot 10 of player with arrow to run [give player 64 arrow]
format slot 19 of player with ender pearl to run [give player 16 ender pearl]
format slot 35 of player with splash Health potion II item to run [give player 373:16421]
format slot 44 of player with steak item to run [give player 64 steak]
format slot 26 of player with 373:8258 to run [give player 373:8258]
format slot 17 of player with 373:8226 to run [give player 373:8226]
format slot 8 of player with 373:8259 to run [give player 373:8259]
Maintenant, je voudrais charger le kit du joueur via un papier, j'ai testé plusieurs codes mais aucun ne marche, voici un de mes codes:
on right click:
if player's tool is a paper:
if name of player's tool is "&3Kit":
clear the player's inventory
wait 0.5 tick
set helmet of player to {helmet.%player%}
wait 0.5 tick
set chestplate of player to {chestplate.%player%}
wait 0.5 tick
set leggings of player to {leggings.%player%}
wait 0.5 tick
set boots of player to {boots.%player%}
wait 0.5 tick
set {_slot} to 0
wait 0.5 tick
loop 36 times:
set slot {_slot} of player's inventory to {Kit.%player%.%{_slot}%}
add 1 to {_slot}
message "&aKit chargé !" to the player
J'espère que vous pourrez m'aider :)
Cordialement, Thinqy.