Aller au contenu

Classement

Contenu populaire

Affichage du contenu avec la meilleure réputation le 10/02/2020 dans Messages

  1. Le any move pique les yeux !! x) Je pense que tu pourrais faire une vérification dans un loop assez simplement : #Bout de code pour la phase téléportation options: #waiting_time est le temps qu'il faut pour que le joueur ne doit pas bouger avant de se faire téléporter waiting_time : 4 message "&6La teleportation vers le spawn commence dans &5 4 &6secondes" set {_loc::x} to x-coord of player set {_loc::y} to y-coord of player set {_loc::z} to z-coord of player loop {@waiting_time}: wait 1 second if {_loc::x} isn't x-coord of player: message "&cTéléportation annulé !" stop if {_loc::y} isn't y-coord of player: message "&cTéléportation annulé !" stop if {_loc::z} isn't z-coord of player: message "&cTéléportation annulé !" stop teleport player to {spawn} message "&6Vous avez été téléporté au &6spawn " En gros, dans mon code, on vérifie si les coords x,y et z avant l'execution de la commande sont différentes de celle d'après l'éxecution. Si c'est le cas (càd qu'au moins un des 3 est différent), la téléportation est annulé. Sinon, il continue autant de fois que tu as mis dans l'option waiting_time Je n'ai pas testé, mais j'espère t'avoir éclairé 😉
    1 point
  2. Salut, tu peux de baser sur le fichier template pour le cooldown : # # This script is a template for commands which have a cooldown. # I will add a more intuitive way of handling cooldowns/countdowns in the future, # But for now please use something like this. # Make sure that you do not use delays for cooldowns as they stop when the server stops. # # This command allows each player to get infinite cakes # but the command has a cooldown of one minute (per player) command /cake: description: Recieve a cake, but you can only do this once per minute! permission: cake.is_a_lie executable by: players trigger: # stores how long it's been since the player last used this command set {_waited} to difference between {cake.%player%.lastused} and now # checks whether the player has used the command within the last minute if {_waited} is less than a minute: message "You have to wait %difference between a minute and {_waited}% before you can use this command again!" stop # some condition which sould not start the cooldown # (if the player doesn't get the cake he should be able to use the command again immediately) player doesn't have space for a cake: message "You do not have enough space in your inventory to hold the cake!" stop # do the action of the command give a cake to the player # and finally start the cooldown set {cake.%player%.lastused} to now et pour quand le joueur bouge, c'est pas très optimisé, mais tu peux essayer un : on any move: if {teleport.%player%.cooldown} is 1: set {teleport.%player%.cooldown} to 2 command /nether: trigger: set {teleport.%player%.cooldown} to 1 send "Téléportation dans 3 secondes" wait 3 seconds if {teleport.%player%.cooldown} is 2: set {teleport.%player%.cooldown} to 0 send "téléportation annulé" stop else if {teleport.%player%.cooldown} is 1: set {teleport.%player%.cooldown} to 0 #le téléporter
    1 point
  3. N'oublie pas de mettre un j'aime : [code]on right click on villager: if player's world is "world": if block above the clicked entity is cobblestone: make player execute "/exemple %player%"
    1 point
×
×
  • 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.