Aller au contenu

comment fait pour metre un cooldown a une commande


Messages recommandés

Posté(e)

je cherche comment pourrait on mettre un cooldown a une commande mon debut de skript

on click with blaze rod:
   if player's world is "serveur" or "pvp-kit" or "skywars"
       make player execute command "/jump"

et la commande en question

command /jump:
   trigger:
       push player upwards at speed 1.5
       push player in direction of player at speed 1.5
       send "&7Tu as ete propulse !"

Posté(e)
Options:

   Cooldown: 10 minutes # ! A mettre en anglais !

function TimeLeft(difference: timespan, timeLeft: timespan) :: text:
   subtract {_difference} from {_timeLeft}
   set {_timeLeft} to "%{_timeLeft}%" parsed as string
   replace all "second" with "seconde" in {_timeLeft}
   replace all "seconds" with "secondes" in {_timeLeft}
   replace all "hour" with "heure" in {_timeLeft}
   replace all "hours" with "hours" in {_timeLeft}
   replace all "day" with "jour" in {_timeLeft}
   replace all "days" with "jours" in {_timeLeft}
   replace all "and" with "et" in {_timeLeft}
   return {_timeLeft}

command /jump:
   trigger:
       if difference between now and {jump.lastused.%player%} is less than {@Cooldown}:
           send "&cErreur : Vous devez patienter encore &4%TimeLeft(difference between now and {jump.lastused.%player%}, {@Cooldown})% &c!"
       else:
           push player upwards at speed 1.5
           push player in direction of player at speed 1.5       
           set {jump.lastused.%player%} to now   

on rightclick with blaze rod:
   if player's world is "serveur" or "pvp-kit" or "skywars":
       make player execute command "/jump"

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