Aller au contenu
  • 0

Retrait de coins


Question

Posté(e)

Bonsoir,

 

Je vous embête ce soir car j'ai besoin d'un peu d'aide.

 

J'aimerais retirer des coins a un joueur quand il clic sur l'item dans un gui :

 

command /gradeguerrier:
   trigger:
       wait 4 ticks
       open chest with 1 rows named "&aValidation de ton achat" to player
       format slot 0 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
       format slot 1 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
       format slot 2 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
       format slot 3 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
       format slot 0 of player with blue stained glass pane named " " to close
       format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command ""]
       format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command ""]
       format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command ""]
       format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command ""]

 

Quand le joueur clic sur une vitre verte, ca lui retire un certain nombre de coins.

 

{tokens.%UUID}

{tokens.%UUID of player%}

 

J'ai ça qui va avec :)

 

Merci de votre aide!

 

AzeLiK

19 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Bonsoir :

command /gradeguerrier [<text>]:
   trigger:
       if arg 1 is not set:
           wait 4 ticks
           open chest with 1 rows named "&aValidation de ton achat" to player
           format slot 0 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 1 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 2 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 3 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 0 of player with blue stained glass pane named " " to close
           format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
       else:
           if arg 1 is "confirm":
               add -5 to {tokens.%UUID of player%}

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

command /gradeguerrier [<text>]:
   trigger:
       if arg 1 is not set:
           wait 4 ticks
           open chest with 1 rows named "&aValidation de ton achat" to player
           format slot 0 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 1 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 2 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 3 of player with red stained glass pane named "&cAnnuler " to close then run [make player execute command ""]
           format slot 0 of player with blue stained glass pane named " " to close
           format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
       else:
           if arg 1 is "confirm":
               add -5 to {tokens.%UUID of player%}

Ou alors tout simplement je crois pour enlever 5 d'une variable tu fais

remove 5 from {tokens.%UUID of player%}

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

Bonsoir,

Voila ton code optimiser, complet, et sans bug

command /gradeguerrier [<text>]:
   executable by : players
   trigger:
       if arg 1 is not set:
           open chest with 1 rows named "&aValidation de ton achat" to player
           wait 1 tick
           format slot 0 of player with red stained glass pane named "&cAnnuler " to close
           format slot 1 of player with red stained glass pane named "&cAnnuler " to close
           format slot 2 of player with red stained glass pane named "&cAnnuler " to close
           format slot 3 of player with red stained glass pane named "&cAnnuler " to close
           format slot 0 of player with blue stained glass pane named " " to close
           format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
       else if arg 1 is "confirm":
           remove 5 from {tokens.%UUID of player%}
       else:
           send "&cFaites /gradeguerrier"

 

Petite question, j'ai vu plusieurs fois le "[make player execute command "/gradeguerrier confirm"]" que la je réutilise du code de Soufreur78 mais moi ça met ce n'est pas du texte, il faut un addons particulier ?

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

J'ai retiré le résolu car je peux descendre en dessous de 0 Tokens :eek:

 

J'ai pas trop trop envie que les joueurs puissent avoir les grades sans payer :p

 

Merci :)

 

Edit:

 

options:
   tokens: &3Adralia &8&l>>

command /coins [<text>] [<player>] [<number>]:
   trigger:
       if player is op:
           if arg 1 is not set:
               message "{@tokens} &aFait /tokens <add|remove> <joueur> <montant>."
           if arg 1 is "add":
               add arg-3 to {tokens.%UUID of arg 2%}
               message "&aTu as donné &c%arg-3%&a Tokens à %arg-2%"
               message "&aTu as reçu &c%arg-3%&a Tokens" to arg 2
           else if arg 1 is "remove":
               if arg 3 is greater than 0:
                   if arg 3 is less than or equal to {tokens.%UUID of arg 2%}:
                       remove arg 3 from {tokens.%UUID of arg 2%}
                       message "{@tokens} &aTu as retiré &c%arg 3%&a Tokens à &c%arg 2% &a!"
                       message "{@tokens} &c%arg 3%&a Tokens ont été retiré de ton compte " to arg 2
                   else:
                       message "{@tokens}&a Tu ne peux pas retiré autant d'argent"
               else:
                   message "{@tokens}&a Tu ne peux pas enlever moins de 1 tokens"

       else:
           message "{@tokens}&cVous n'avez pas accès a cette commande !"

command /tokens:
   trigger:
       if {tokens.%UUID of player%} is not set:
           set {tokens.%UUID of player%} to 0
       else:
       message "{@tokens} &aTu as &c%{tokens.%UUID of player%}% &aTokens"

 

Je vous ajoute le skript coins qui peut vous aider :)

  • 0
Posté(e)

Tien :)

command /gradeguerrier [<text>]:
   executable by : players
   trigger:
       if arg 1 is not set:
           open chest with 1 rows named "&aValidation de ton achat" to player
           wait 1 tick
           format slot 0 of player with red stained glass pane named "&cAnnuler " to close
           format slot 1 of player with red stained glass pane named "&cAnnuler " to close
           format slot 2 of player with red stained glass pane named "&cAnnuler " to close
           format slot 3 of player with red stained glass pane named "&cAnnuler " to close
           format slot 0 of player with blue stained glass pane named " " to close
           format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
       else if arg 1 is "confirm":
           if {tokens.%UUID of player%} >= 5:
               remove 5 from {tokens.%UUID of player%}
               message "&eMerci &c%player% &epour ton achat"
           else:   
               message "&8[&e&l!&8] &cIl vous faut 5 tokens pour ceci, vous n'en avez que &e%{tokens.%UUID of player%}%"
       else:
           send "&cFaites /gradeguerrier"

  • 0
Posté(e)

Merc

Tien :)

command /gradeguerrier [<text>]:
   executable by : players
   trigger:
       if arg 1 is not set:
           open chest with 1 rows named "&aValidation de ton achat" to player
           wait 1 tick
           format slot 0 of player with red stained glass pane named "&cAnnuler " to close
           format slot 1 of player with red stained glass pane named "&cAnnuler " to close
           format slot 2 of player with red stained glass pane named "&cAnnuler " to close
           format slot 3 of player with red stained glass pane named "&cAnnuler " to close
           format slot 0 of player with blue stained glass pane named " " to close
           format slot 5 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 6 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 7 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
           format slot 8 of player with green stained glass pane named "&aConfirmer " to close then run [make player execute command "/gradeguerrier confirm"]
       else if arg 1 is "confirm":
           if {tokens.%UUID of player%} >= 5:
               remove 5 from {tokens.%UUID of player%}
               message "&eMerci &c%player% &epour ton achat"
           else:  
               message "&8[&e&l!&8] &cIl vous faut 5 tokens pour ceci, vous n'en avez que &e%{tokens.%UUID of player%}%"
       else:
           send "&cFaites /gradeguerrier"

Merci, et si je veux l'ajouter au skript coins, je fais comment?? o_O

  • 0
Posté(e)
Merc

 

Merci, et si je veux l'ajouter au skript coins, je fais comment?? o_O

C'est quoi skript coins ? Je peux t'aider mais je sais pas qu'est ce " skript coins " :eek:

  • 0
Posté(e)
C'est quoi skript coins ? Je peux t'aider mais je sais pas qu'est ce " skript coins " :eek:

Le skript de coins c'est celui un peu plus haut :)

  • 0
Posté(e)
Bas tu la fait à ma place jairais pas fait mieux.

 

N'oublie pas de mettre résolu.

Non, je peux aller en dessous de 0

 

Edit

 

Okay c'est bon excuse moi :)

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