Aller au contenu
  • 0

Cooldown de 24 heures


Question

Posté(e)

Salut !

Aujoutd'hui j'aurai besoin d'aides qui est De mettre Un Temps Sur la command /noel (code en desous)

En gros ont peut executer cette commande tout les 24H

Code :

command /noel:
   trigger:
       open chest with 3 rows named "&cNoel" to player
       format slot 0 of player with 0 160 named "" with lore "" to close then run ""
       format slot 1 of player with 0 160:14 named "" with lore "" to close then run ""
       format slot 2 of player with 0 160 named "" with lore "" to close then run ""
       format slot 3 of player with 0 160:14 named "" with lore "" to close then run ""
       format slot 4 of player with 0 160 named "" with lore "" to close then run ""
       format slot 5 of player with 0 160:14 named "" with lore "" to close then run ""
       format slot 6 of player with 0 160 named "" with lore "" to close then run ""
       format slot 7 of player with 0 160:14 named "" with lore "" to close then run ""
       format slot 8 of player with 0 160 named "" with lore "" to close then run ""
       format slot 9 of player with 0 160:14 named "" with lore "" to close then run ""
       format slot 10 of player with 0 160 named "" with lore "" to close then run ""
       format slot 11 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 12 of player with 1 388 named "" with lore "" to close then run ""
       format slot 13 of player with 1 54 named "" with lore "" to close then run "box %player% 1"
       format slot 14 of player with 1 388 named "" with lore "" to close then run ""
       format slot 15 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 16 of player with 1 160 named "" with lore "" to close then run ""
       format slot 17 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 18 of player with 1 160 named "" with lore "" to close then run ""
       format slot 19 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 20 of player with 0 160 named "" with lore "" to close then run ""
       format slot 21 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 22 of player with 1 160 named "" with lore "" to close then run ""
       format slot 23 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 24 of player with 1 160 named "" with lore "" to close then run ""
       format slot 25 of player with 1 160:14 named "" with lore "" to close then run ""
       format slot 26 of player with 1 160 named "" with lore "" to close then run ""

12 réponses à cette question

Messages recommandés

  • 0
Posté(e)

a la fin tu set une variable, par exemple {cooldown.%player%}

 

Puis tu met un wait 24 hours

 

et tu delete {cooldown.%player%}

 

et au debut de la commande:

 

If {cooldown.%player%} is set:

message "Attendez un peu"

stop

 

C'est important, AIME et deviens FAN

  • 0
Posté(e)

Bonsoir,

Le "wait" est une mauvaise idée si ne me trompe, si le serveur vient a redémarrer le wait ne serra plus actif.

 

Event: #Lancement de code.
   If {name of skript.cooldown.%player%} is set:    #On vérifie si la variable est pleine.
       if difference between {name of skript.cooldown.%player%} and now is bigger than a day:    #On regarde la date de la variable et c'elle actuel est plus grande que 24h

   Else if {name of skript.cooldown.%player%} is not set:
       set {name of skript.cooldown.%player%} to now

 

Cordialement.

  • 0
Posté(e)

En effet, le wait n'est pas bon quand le serveur reset, mais aussi ça prend en compte les lags, du coup si y'a 19 TPS, ça fera déjà un énorme décalage à la fin.

  • J'aime 1
  • 0
Posté(e)

Le mieux

c'est d'enregistrer dans une variable la date et l'heure a la quel le joueur a exécuter la commande "voire timespan"

 

puis si il ré-exécute la commande, tu compare la date et l'heure actuel " now " avec celle que tu lui as enregistré , si c'est supérieur a 24h pas de problème, sinon ont lui affiche un message comme quoi il doit encore attendre.

 

en gros c'est un système de cooldown

  • 0
Posté(e)
Le mieux

c'est d'enregistrer dans une variable la date et l'heure a la quel le joueur a exécuter la commande "voire timespan"

 

puis si il ré-exécute la commande, tu compare la date et l'heure actuel " now " avec celle que tu lui as enregistré , si c'est supérieur a 24h pas de problème, sinon ont lui affiche un message comme quoi il doit encore attendre.

 

en gros c'est un système de cooldown

je ses pas faire sa :'(

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