Aller au contenu
  • 0

Skript de kits besoin d'un timer entre chaque kit


Question

Posté(e)

j'ai crée des kits mais j'aimerais que une fois qu'on ais pris un kit on doit attendre 3 h avant de refaire le kit et que quand on doit attendre pour faire le kit, qu'il soit barré dans la liste des kits.

command /kit [<text>]:
   aliases: kits
   trigger:
       if arg 1 is set:
           if arg 1 is "Soldat":
               if player has permission "kits.joueur":
                   give 1 diamond helmet of protection 2 to player
                   give 1 plastron emeraude of protection 1 to player
                   give 1 jambiere emeraude of protection 1 to player
                   give 1 diamond boots of protection 2 to player
                   give 1 epee en emeraude of sharpness 1 to player
                   give 2 golden apple to player
                   give 1 diamond pickaxe of efficiency 1 to player
                   give 1 diamond axe of efficiency 1 to player
                   give 1 diamond shovel of efficiency 1 to player
           if arg 1 is "Mercenaire":
               if player has permission "kits.soldat":
                   give 1 casque emeraude of protection 1 to player
                   give 1 plastron emeraude of protection 1 to player
                   give 1 jambiere emeraude of protection 1 to player
                   give 1 bottes emeraude of protection 1 to player
                   give 1 epee en topaze of sharpness 1 to player
                   give 6 golden apple to player
                   give 1 pioche en emeraude of efficiency 1 to player
                   give 1 ache en emeraude of efficiency 1 to player
                   give 1 pelle en emeraude of efficiency 1 to player
           if arg 1 is "Hero":
               if player has permission "kits.hero":
                   give 1 casque opale of protection 1 to player
                   give 1 plastron emeraude of protection 1 to player
                   give 1 jambiere emeraude of protection 1 to player
                   give 1 bottes opale of protection 1 to player
                   give 1 epee en opale of sharpness 1 to player
                   give 10 golden apple to player
                   give 1 pioche en opale of efficiency 1 to player
                   give 1 ache en opale of efficiency 1 to player
                   give 1 pelle en opale of efficiency 1 to player
           if arg 1 is "Marechal":
               if player has permission "kits.marechal":
                   give 1 casque opale of protection 1 to player
                   give 1 plastron opale of protection 1 to player
                   give 1 jambiere opale of protection 1 to player
                   give 1 bottes acier of protection 1 to player
                   give 1 epee en opale of sharpness 2 and fire aspect 1 to player
                   give 16 golden apple to player
                   give 1 pioche en opale of efficiency 1 to player
                   give 1 ache en opale of efficiency 1 to player
                   give 1 pelle en opale of efficiency 1 to player
       else:
           send "&6Kits: &fSoldat &fMercenaire &fHero &fMarechal"

 

Merci a tous ceux qui apporterons leur aide si ils en sont capable.

12 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Voila c'est fait :D

petites précisions : -Je n'ai pas pu vérifier si on récupérait bien tous les items vu que tu joues en moddé.

-Je n'ai pas fait le système du kit barré, mais plutôt un timer qui s'affiche avec le temps restant avant la prochaine utilisation(si tu y tiens vraiment, je peux te le faire ;D )

-J'ai rajouté un "TabCompleter" (plus besoin de noter tout le nom du kit, suffit de faire tab)

 

Le Code : (normalement sans erreurs)

command /kit [<text>]:
   aliases: kits
   trigger:
       if arg 1 is set:
           if arg 1 is "Soldat":
               if player has permission "kits.joueur":
                   if {kitsol.cooldown.%player%} is not set:
                       set {kitsol.cooldown.%player%} to now
                       give 1 diamond helmet of protection 2 to player
                       give 1 diamond chestplate of protection 1 to player
                       give 1 diamond leggings of protection 1 to player
                       give 1 diamond boots of protection 2 to player
                       give 1 diamond sword of sharpness 1 to player
                       give 2 golden apple to player
                       give 1 diamond pickaxe of efficiency 1 to player
                       give 1 diamond axe of efficiency 1 to player
                       give 1 diamond shovel of efficiency 1 to player
                   else:
                       if difference between {kitsol.cooldown.%player%} and now >= 3 hours:
                           set {kitsol.cooldown.%player%} to now
                           give 1 diamond helmet of protection 2 to player
                           give 1 diamond chestplate of protection 1 to player
                           give 1 diamond leggings of protection 1 to player
                           give 1 diamond boots of protection 2 to player
                           give 1 diamond sword of sharpness 1 to player
                           give 2 golden apple to player
                           give 1 diamond pickaxe of efficiency 1 to player
                           give 1 diamond axe of efficiency 1 to player
                           give 1 diamond shovel of efficiency 1 to player
                       else:  
                           set {_sl} to {kitsol.cooldown.%player%}
                           add 3 hours to {_sl}
                           set {_sl} to difference between {_sl} and now
                           message "&2>> &aVous devez encore attendre &6%{_sl}% %nl%&aavant de pouvoir récupérer ce Kit."
           else if arg 1 is "Mercenaire":
               if player has permission "kits.soldat":
                   if {kitmer.cooldown.%player%} is not set:
                       set {kitmer.cooldown.%player%} to now
                       give 1 casque emeraude of protection 1 to player
                       give 1 plastron emeraude of protection 1 to player
                       give 1 jambiere emeraude of protection 1 to player
                       give 1 bottes emeraude of protection 1 to player
                       give 1 epee en topaze of sharpness 1 to player
                       give 6 golden apple to player
                       give 1 pioche en emeraude of efficiency 1 to player
                       give 1 ache en emeraude of efficiency 1 to player
                       give 1 pelle en emeraude of efficiency 1 to player
                   else:
                       if difference between {kitmer.cooldown.%player%} and now >= 3 hours:
                           set {kitmer.cooldown.%player%} to now
                           give 1 casque emeraude of protection 1 to player
                           give 1 plastron emeraude of protection 1 to player
                           give 1 jambiere emeraude of protection 1 to player
                           give 1 bottes emeraude of protection 1 to player
                           give 1 epee en topaze of sharpness 1 to player
                           give 6 golden apple to player
                           give 1 pioche en emeraude of efficiency 1 to player
                           give 1 ache en emeraude of efficiency 1 to player
                           give 1 pelle en emeraude of efficiency 1 to player
                       else:  
                           set {_sl} to {kitmer.cooldown.%player%}
                           add 3 hours to {_sl}
                           set {_sl} to difference between {_sl} and now
                           message "&2>> &aVous devez encore attendre &6%{_sl}% %nl%&aavant de pouvoir récupérer ce Kit."
           if arg 1 is "Hero":
               if player has permission "kits.hero":
                   if {kithero.cooldown.%player%} is not set:
                       set {kithero.cooldown.%player%} to now
                       give 1 casque emeraude of protection 1 to player
                       give 1 plastron emeraude of protection 1 to player
                       give 1 jambiere emeraude of protection 1 to player
                       give 1 bottes emeraude of protection 1 to player
                       give 1 epee en topaze of sharpness 1 to player
                       give 6 golden apple to player
                       give 1 pioche en emeraude of efficiency 1 to player
                       give 1 ache en emeraude of efficiency 1 to player
                       give 1 pelle en emeraude of efficiency 1 to player
                   else:
                       if difference between {kithero.cooldown.%player%} and now >= 3 hours:
                           set {kithero.cooldown.%player%} to now
                           give 1 casque emeraude of protection 1 to player
                           give 1 plastron emeraude of protection 1 to player
                           give 1 jambiere emeraude of protection 1 to player
                           give 1 bottes emeraude of protection 1 to player
                           give 1 epee en topaze of sharpness 1 to player
                           give 6 golden apple to player
                           give 1 pioche en emeraude of efficiency 1 to player
                           give 1 ache en emeraude of efficiency 1 to player
                           give 1 pelle en emeraude of efficiency 1 to player
                       else:  
                           set {_sl} to {kithero.cooldown.%player%}
                           add 3 hours to {_sl}
                           set {_sl} to difference between {_sl} and now
                           message "&2>> &aVous devez encore attendre &6%{_sl}% %nl%&aavant de pouvoir récupérer ce Kit."
           if arg 1 is "Marechal":
               if player has permission "kits.marechal":
                   if {kitmar.cooldown.%player%} is not set:
                       set {kitmar.cooldown.%player%} to now
                       give 1 casque opale of protection 1 to player
                       give 1 plastron opale of protection 1 to player
                       give 1 jambiere opale of protection 1 to player
                       give 1 bottes acier of protection 1 to player
                       give 1 epee en opale of sharpness 2 and fire aspect 1 to player
                       give 16 golden apple to player
                       give 1 pioche en opale of efficiency 1 to player
                       give 1 ache en opale of efficiency 1 to player
                       give 1 pelle en opale of efficiency 1 to player
                   else:
                       if difference between {kitmar.cooldown.%player%} and now >= 3 hours:
                           set {kitmar.cooldown.%player%} to now
                           give 1 casque opale of protection 1 to player
                           give 1 plastron opale of protection 1 to player
                           give 1 jambiere opale of protection 1 to player
                           give 1 bottes acier of protection 1 to player
                           give 1 epee en opale of sharpness 2 and fire aspect 1 to player
                           give 16 golden apple to player
                           give 1 pioche en opale of efficiency 1 to player
                           give 1 ache en opale of efficiency 1 to player
                           give 1 pelle en opale of efficiency 1 to player
                       else:  
                           set {_sl} to {kitmar.cooldown.%player%}
                           add 3 hours to {_sl}
                           set {_sl} to difference between {_sl} and now
                           message "&2>> &aVous devez encore attendre &6%{_sl}% %nl%&aavant de pouvoir récupérer ce Kit."
       else:
           send "&6Kits: &fSoldat &fMercenaire &fHero &fMarechal"

on tab completer for "kit":
   add "Soldat" to completions
   add "Mercenaire" to completions
   add "Hero" to completions
   add "Marechal" to completions

 

Voila si ça fonctionne pour toi passe en résolu :)

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

Merci tes génial, ça marche très bien mais dis moi t'aurrais pas une astuce pour mettre des accents dans un skript ? Parceque mi ça me met des points d'interrogation xD

[ATTACH=full]5922[/ATTACH]

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