Aller au contenu
  • 0

[Modération] Hmm :c


Question

Posté(e)

Bonjour, je viens de rédiger un skript qui m'affiche aucunes erreurs ;c Mais quand on execute la commande /mod c'est comme si il l'excutait deux fois. C'est a dire que je reviens a ma position initiale sans les items

 

 

options:
   p: &8[&c&lModération&8]
   e: &8[&c&lErreur&8]



command /mod:
   permission: mod.use
   permission message: &cTu n'as pas la permission...
   trigger:
       If {mod.%player%} is not set:
           set {mod.inventaire.%player%} to player's serialized inventory
           set {mod.save.1.%player%} to helmet of player
           set {mod.save.2.%player%} to chestplate of player
           set {mod.save.3.%player%} to leggings of player
           set {mod.save.4.%player%} to boots of player
           set {mod.location.%player%} to location of player
           wait 2 ticks
           clear player's inventory
           send "{@p} &7» &aInventaire sauvegardé et clear ! ✔"
           player command "vanish on"
           give 1 diamond sword named "&8[&4Kill&8]" to player
           give 1 head named "&8[&dRandomTP&8]" to player
           give 1 chest named "&8[&eInventory&8]" to player
           give 1 packed ice named "&8[&bFreeze&8]" to player
           give 1 fishing rod of unbreaking 3, knockback 2 named "&8[&9KBTester&8]" to player
           give 1 blaze rod named "&8[&cVanish&8]" to player
           send "{@p} &7» &aMode Modération activé ! &b&l&oTu peux modérér en toute sécurité !"
           set {mod.%player%} to true
       If {mod.%player%} is set:
           clear player's inventory
           execute player command "/vanish OFF"
           wait 1 ticks
           send "&a&lMode modération désactivé !"
           clear {mod.%player%}
           execute console command "/gamemode 0 %player%"
           restore inventory of player from {mod.inventaire.%player%}
           set helmet of player to {mod.save.1.%player%}
           set chestplate of player to {mod.save.2.%player%}
           set leggings of player to {mod.save.3.%player%}
           set boots of player to {mod.save.4.%player%}
           teleport player to {mod.location.%player%}
           stop



on leftclick with head:
   if name of tool is "&8[&dRandomTP&8]":
       if {mod.%player%} is true:
           loop all players:
               add loop-player to {joueur.tp::*}
           set {player.tp.%player%} to a random element out of {joueur.tp::*}
           if {player.tp.%player%} is player:
               send "{@e}&7 » &aRéesaye !"
           else:
               teleport player to {player.tp.%player%}
               delete {joueur.tp::*}
               send "{@p} &7» &cTu as été téléporté à &4%{player.tp.%player%}%"


on rightclick with blaze rod:
   if name of tool is "&8[&cVanish&8]":
       if {mod.%player%} is true:
           execute player command "/vanish"

on rightclick with anvil:
   if name of tool is "&8[&eInventory&8]":
       if {mod.%player%} is true:
           set {_targetplayer} to targeted player
           if {_targetplayer} is a player:
               player command "invview %targeted player%"
           else:
               send "{@e} &7» &cVous devez visez un joueur !"


on rightclick with packed ice:
   if name of tool is "&3&lFreeze":
       if {mod.%player%} is true:
           set {_targetplayer} to targeted player
           if {_targetplayer} is a player:
               execute player command "/freeze %targeted player%"
           else:
               send "{@e} &7» &cVous devez visez un joueur !"

on rightclick with diamond sword:
   if name of tool is "&8[&4Kill&8]":
       if {mod.%player%} is true:
           set {_targetplayer} to targeted player
           if {_targetplayer} is a player:
               execute player command "/minecraft:kill %targeted player%"
           else:
               send "{@e} &7» &cVous devez visez un joueur !"


#------------------------------------

command /vanish [<text>]:
   permission: mod.use
   trigger:
       if arg 1 is "ON":
           hide player from all players
           send "{@p} &7» &bPersonne ne vous vois à présent ! "
           set {vanish.%player%} to true
       if arg 1 is "OFF":
           reveal player from all players
           send "{@p} &7» &cRetour en mode normal ! &9Vous êtes visibles par tous les joueurs"
           clear {vanish.%player%}
       else if arg 1 is not set:
           if {vanish.%player%} is not set:
               hide player from all players
               send "{@p} &7» &bPersonne ne vous vois à présent ! "
               set {vanish.%player%} to true
           else if {vanish.%player%} is true:
               reveal player from all players
               send "{@p} &7» &cRetour en mode normal ! &9Vous êtes visibles par tous les joueurs"
               clear {vanish.%player%}


#--------------------------------------------


3 réponses à cette question

Messages recommandés

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