Aller au contenu

Messages recommandés

Posté(e)

Bonjour, je possède un kit mais je voudrais que le kit soit faisable seulement toutes les 30 secondes par exemple.

En gros quand tu fais /kit guerrier tu obtiens un kit (ça j'y arrive) mais que une fois que tu as fais la commande il faut attendre 30 secondes avant de pouvoir refaire la commande.

Si l'on fait la commande durant le countdown on a un message "Tu dois encore attendre %{variablecountdown}% secondes"

 

[spoiler=Mon code (ça ne marche pas)]

Command /kitarène <text>:

permission: op.sk

permission message: &7[&6TigerApple&7] &cCommande réservé au Staff

trigger:

if arg 1 is "list":

send "&c&nListe des kits :&r &3Guerrier, &2Archer, &8Tank, &dAlchimiste"

if arg 1 is "Guerrier":

if {countdownguerrier} is true:

clear player's inventory

equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"

equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"

equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"

equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"

give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"

give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"

give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"

give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"

message "&3&oKit Guerrier équipé"

set {countdownguerrier} to false

set {_timeguerrier} to 30

while {_timeguerrier} is more than 0:

{_timeguerrier} is more than 0:

remove 1 from {_timeguerrier}

wait 1 second

send "&3Hey, le countdown est terminé !" to player

set {countdownguerrier} to true

else:

send "&3Tu dois encore attendre &b%{_timeguerrier}%&3 secondes !"

 

 

 

Merci d'avance si vous y arrivez :)

Posté(e)

Voila voila! Tout fonctionne (normalement, pas encore testé ^^ n'hésite pas a me mp si ça marche pas ou si tu as une question) et pour les autres kits, tu auras juste à modifier le stuff givé, je t'ai preparé les commandes!

 

Command /kitarène <text>:
   permission: op.sk
   permission message: &7[&6TigerApple&7] &cCommande réservé au Staff
       trigger:
       if arg 1 is not set:
           send "&c&nListe des kits :&r &3Guerrier, &2Archer, &8Tank, &dAlchimiste"
       if arg 1 is "list":
           send "&c&nListe des kits :&r &3Guerrier, &2Archer, &8Tank, &dAlchimiste"
       if arg 1 is "Guerrier":
           if {kit.guerrier.%player%} is not set:
               set {kit.guerrier.%player%} to true
               send "&3Attentez 30secondes pour réutiliser ce kit!"
               clear player's inventory
               equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"
               equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"
               equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"
               equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"
               give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"
               give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"
               give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"
               give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"
               message "&3&oKit Guerrier équipé"
               wait 30 second
               delete {kit.guerrier.%player%}   
               send "&3Hey, le countdown est terminé !" to player
           else:
               send "&cVeuillez attendre un peut avant de reprendre un Kit Guerrier!"

       if arg 1 is "Archer":
           if {kit.archer.%player%} is not set:
               set {kit.archer.%player%} to true
               send "&3Attentez 30secondes pour réutiliser ce kit!"
               clear player's inventory
               equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"
               equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"
               equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"
               equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"
               give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"
               give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"
               give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"
               give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"
               message "&3&oKit Archer équipé"
               wait 30 second
               delete {kit.archer.%player%}   
               send "&3Hey, le countdown est terminé !" to player
           else:
               send "&cVeuillez attendre un peut avant de reprendre un Kit Archer!"

       if arg 1 is "Tank":
           if {kit.tank.%player%} is not set:
               set {kit.tank.%player%} to true
               send "&3Attentez 30secondes pour réutiliser ce kit!"
               clear player's inventory
               equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"
               equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"
               equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"
               equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"
               give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"
               give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"
               give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"
               give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"
               message "&3&oKit Tank équipé"
               wait 30 second
               delete {kit.tank.%player%}   
               send "&3Hey, le countdown est terminé !" to player
           else:
               send "&cVeuillez attendre un peut avant de reprendre un Kit Tank!"

       if arg 1 is "Alchimiste":
           if {kit.alchimiste.%player%} is not set:
               set {kit.alchimiste.%player%} to true
               send "&3Attentez 30secondes pour réutiliser ce kit!"
               clear player's inventory
               equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"
               equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"
               equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"
               equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"
               give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"
               give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"
               give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"
               give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"
               message "&3&oKit Alchimiste équipé"
               wait 30 second
               delete {kit.alchimiste.%player%}   
               send "&3Hey, le countdown est terminé !" to player
           else:
               send "&cVeuillez attendre un peut avant de reprendre un Kit Alchimiste!"

Like si ça ta aidé et n'hésite pas à passer me voir sur mon ts si tu as besoin d'autre chose!

ts: im-gs.fr

  • J'aime 1
Posté(e)

Attention @Trevili !

Si le joueur se déconnecte pendant le countdown,

la variable du kit ne sera pas enlevée !

il faudrait rajouter

 

on quit:
       clear {kit.guerrier.%uuid of player%}
       clear {kit.archer.%uuid of player%}
       clear {kit.tank.%uuid of player%}
       clear {kit.alchimiste.%uuid of player%}

  • J'aime 2
Posté(e)

Il faut simplement à l'utilisation

du kit, ajouter 30 à {countdown.lekit.%uuid of player%}

et un décompte de wait 1 second suivi de remove 1 from {countdown.lekit.%uuid of player%}

et quand le joueur fais la commande, tu fais un send message "%{countdown.lekit.%uuid of player% }%"

pour voir à combien il en est rendu.

Je ne peux pas le faire maintenant,

mais au moins tu as les explications :p

Posté(e)

Merci à vous, j'ai fusionné mon premier code avec et tout est nickel :D

Si ça vous intéresse voici le code :

Command /kitarène <text>:
   permission: op.sk
   permission message: &7[&6TigerApple&7] &cCommande réservé au Staff
   trigger:
       if arg 1 is not set:
           send "&c&nListe des kits :&r &3Guerrier, &2Archer, &8Tank, &dAlchimiste"
       if arg 1 is "list":
           send "&c&nListe des kits :&r &3Guerrier, &2Archer, &8Tank, &dAlchimiste"
       if arg 1 is "Guerrier":
           if {kit.guerrier.%player%} is not set:
               set {kit.guerrier.%player%} to true
               clear player's inventory
               equip player with iron helmet of protection 2 named "&3Casque" with lore "&4&lKit Guerrier"
               equip player with iron chestplate of protection 2 named "&3Plastron" with lore "&4&lKit Guerrier"
               equip player with iron leggings of protection 2 named "&3Pantalon" with lore "&4&lKit Guerrier"
               equip player with iron boots of protection 2 named "&3Chaussures" with lore "&4&lKit Guerrier"
               give player 1 iron sword of sharpness 3 named "&3Epée" with lore "&4&lKit Guerrier"
               give player 1 bow of power 1 named "&bArc" with lore "&4&lKit Guerrier"
               give player 5 golden apple named "&cPomme dorée" with lore "&4&lKit Guerrier"
               give player 16 arrow named "&bFlèches" with lore "&4&lKit Guerrier"
               message "&7[&6TigerApple&7] &b&oKit Guerrier équipé"
#                wait 30 second
               set {countdown.guerrier.%uuid of player%} to 30
               while {countdown.guerrier.%uuid of player%} is more than 0:
                   {countdown.guerrier.%uuid of player%} is more than 0:
                       remove 1 from {countdown.guerrier.%uuid of player%}
                       wait 1 second
               send "&7[&6TigerApple&7]&b&o Hey ! Ton kit &lGuerrier&r&b&o est de nouveau disponible !" to player
               delete {kit.guerrier.%player%} 
           else:
               send "&cPatiente encore %{countdown.guerrier.%uuid of player%}% secondes pour récupérer ton kit."

 

Le seul petit bémol c'est que c'est seulement en secondes, mais si vous avez une idée pour les minutes allez-y :)

Edit : Et également que si le joueur est full le stuff n'est pas give (il faudrait qu'il tombe par terre pour ne pas le perdre)

×
×
  • 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.