Update du code
[spoiler=Code]
#----- VARRIABLES
variables:
{number.player} = 0
{wool.%player%} = wool
{woolcolor.%player%} = 0
{woolblock.%player%} = 0
#----------#----------#----------#----------#
# #
# Conditions #
# #
#----------#----------#----------#----------#
#-- Quand joueur clique sur le panneau
on click on sign:
if line 1 of clicked block is "[Wexp]":
if line 2 of clicked block is "Arena":
send "Tu as cliqué sur le panneau" to player
#-- Quand - de 4 joueurs
if {number.player} < 4:
set line 3 to "Event ouvert !"
add 1 to {number.player}
set line 4 to "%{number.player}%/4"
#-- Couleur de la laine
add 1 to {woolcolor.%player%}
set data value of {wool.%player%} to {woolcolor.%player%}
give a diamond hoe to player
send "Tu es téléporté à l'arène !"
execute console command "/warp wexparena %player%"
set {Game.Start} to true
#-- Quand + de 4 joueurs
if {number.player} >= 4:
execute console command "/wexp close"
set line 3 to "Event full !"
on rightclick on mycelium with any hoe:
if player is in "woolexpworld":
if player is holding diamond hoe:0:
set clicked block to {wool.%player%}
damage tool by 1
add 1 to {woolblock::%player%}
play raw sound "random.pop" at player with pitch 0.5 volume 0.2
block east is {wool.%player%}:
set clicked block to {wool.%player%}
add 1 to {woolblock::%player%}
play raw sound "random.pop" at player wich pitch 0.5 volume 0.2
block west is {wool.%player%}:
set clicked block to {wool.%player%}
add 1 to {woolblock::%player%}
play raw sound "random.pop" at player with pitch 0.5 volume 0.2
block south is {wool.%player%}:
set clicked block to {wool.%player%}
add 1 to {woolblock::%player%}
play raw sound "random.pop" at player with pitch 0.5 volume 0.2
block north is {wool.%player%}:
set clicked block to {wool.%player%}
add 1 to {woolblock::%player%}
play raw sound "random.pop" at player with pitch 0.5 volume 0.2
#----------#----------#----------#----------#
# #
# Commandes #
# #
#----------#----------#----------#----------#
command /wexp <text>:
permission: skript.wexp.woolexp
trigger:
#-- Quand l'event est fermé ou full
if arg is "close":
broadcast "Event fermé ou full"
execute console command "/wexp start"
#-- Quand le mini jeu est finis
if arg is "finish":
broadcast "Event finis, reset en cours"
loop {woolblock::*}:
broadcast "%loop-index% -> %{woolblock::%loop-index%}%"
execute console command "/wexp reset"
#-- Reset de la map + variables
if arg is "reset":
set {number.player} to 0
broadcast "Event reset !"
loop players:
if loop-player is in "woolexpworld":
send "slt" to loop-player
set {wool.%player%} to wool
set {woolblock::*} to 0
set {woolcolor.%player%} to 0
set data value of {wool.%player%} to 1
execute console command "/warp signwexp %loop-player%"
#-- Première commande quand le match commence, compteur
if arg is "start":
broadcast "Le match commence ! Il vous reste 60 secondes"
wait 30 seconds
broadcast "Il vous reste 30 secondes"
#wait 20 seconds
broadcast "Il vous reste 10 secondes"
wait 5 seconds
broadcast "Il vous reste 5 secondes"
wait 1 seconds
broadcast "Il vous reste 4 secondes"
wait 1 seconds
broadcast "Il vous reste 3 secondes"
wait 1 seconds
broadcast "Il vous reste 2 secondes"
wait 1 seconds
broadcast "Il vous reste 1 secondes"
wait 1 seconds
broadcast "Le match est finis"
execute console command "/wexp finish"
J'ai changer la partie commande. On a ainsi une seule et même commande avec plusieurs type d'argument possible.