Bonjour, je commence à coder en Skript et on m'a conseillé d'utiliser le "while" pour ce code, je voudrais que lorsque je lance la commande /start, si pendant la partie, {number.red} = 0 ou si {numeber.blue} = 0, les effets s'activent. Mais donc il faudrait refresh ces conditions jusqu'à ce qu'une d'entre les 2 soit remplie.
Voici le code :
command /start:
permission: sk.start
permission message: <yellow>Tu n'as pas la permission de faire ca !
trigger:
teleport players to {lobby}
set {number.blue} to 0
set {number.red} to 0
execute console command "/rechest"
clear all entities
loop all players:
set {stats.killstreak.%loop-player%} to 0
set {stats.kill.%loop-player%} to 0
clear {cooldown.%loop-player%.sword}
if {red.%loop-player%} is set:
set {lives.%loop-player%} to 3
if {blue.%loop-player%} is set:
set {lives.%loop-player%} to 3
broadcast "<yellow>Début dans 20 secondes !"
wait 10 seconds
broadcast "<yellow>Début dans 10 secondes !"
wait 5 seconds
broadcast "<yellow>Début dans 5 secondes !"
wait 2 seconds
broadcast "<yellow>Début dans 3 secondes !"
wait 3 seconds
broadcast "<yellow>Téléportation..."
wait 30 ticks
loop all players:
if {red.%loop-player%} is true:
teleport loop-players to {spawn.red}
clear inventory of loop-players
remove swiftness from loop-players
remove strength from loop-players
remove regeneration from loop-players
wait a tick
heal loop-player
wait a tick
equip loop-players with diamond helmet of protection 2
equip loop-players with diamond chestplate of protection 2
equip loop-players with diamond leggings of protection 2
equip loop-players with diamond boots of protection 2, feather falling 4
give a diamond sword of sharpness 1 named "&b%loop-player% Sword" to loop-players
give a bow of power 2, infinity 1 named "&b%loop-player% Bow" to loop-players
give 3 golden apple to loop-players
give 1 potion of:8194 to the loop-players
give 3 splash Regeneration potion item to the loop-players
give 6 extended splash Health potion item to the loop-players
give 1 arrows to loop-players
wait a tick
apply potion of regeneration 1 to loop-players for 15 seconds
apply potion of speed 1 to loop-players for 60 seconds
if {blue.%loop-player%} is true:
teleport loop-players to {spawn.blue}
clear inventory of loop-players
wait a tick
heal loop-player
wait a tick
equip loop-players with diamond helmet of protection 2
equip loop-players with diamond chestplate of protection 2
equip loop-players with diamond leggings of protection 2
equip loop-players with diamond boots of protection 2, feather falling 4
give a diamond sword of sharpness 1 named "&b%loop-player% Sword" to loop-players
give a bow of power 2, infinity 1 named "&b%loop-player% Bow" to loop-players
give 3 golden apple to loop-players
give 1 potion of:8194 to the loop-players
give 3 splash Regeneration potion item to the loop-players
give 6 extended splash Health potion item to the loop-players
give 1 arrows to loop-players
wait a tick
apply potion of regeneration 1 to loop-players for 15 seconds
apply potion of speed 1 to loop-players for 60 seconds
if {blue.%loop-player%} is true:
add 1 to {number.blue}
if {red.%loop-player%} is true:
add 1 to {number.red}
broadcast "<purple><bold>C'est parti pour le fight !"
execute console command "/chest"
while {numer.red} = 0:
broadcast "&cBravo à l'équipe Red qui remporte cette manche !"
wait 1 tick
loop all players:
clear {blue.%loop-player%}
clear {red.%loop-player%}
set {number.red} to 0
set {number.blue} to 0
set the display name of loop-players to "%loop-player%"
execute console command "/nte player %loop-player% clear"
remove swiftness from loop-players
remove strength from loop-players
remove regeneration from loop-players
wait 3 seconds
clear inventory of players
teleport players to {spawn}
stop
while {number.blue} = 0
broadcast "<blue>Bravo à l'équipe Blue qui remporte cette manche !"
wait 1 tick
loop all players:
clear {blue.%loop-player%}
clear {red.%loop-player%}
set {number.red} to 0
set {number.blue} to 0
remove swiftness from loop-players
remove strength from loop-players
remove regeneration from loop-players
wait 3 seconds
clear inventory of players
teleport players to {spawn}
stop
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.
Question
iDrox
Bonjour, je commence à coder en Skript et on m'a conseillé d'utiliser le "while" pour ce code, je voudrais que lorsque je lance la commande /start, si pendant la partie, {number.red} = 0 ou si {numeber.blue} = 0, les effets s'activent. Mais donc il faudrait refresh ces conditions jusqu'à ce qu'une d'entre les 2 soit remplie.
Voici le code :
4 réponses à cette question
Messages recommandés