Guest User

Code Source Animals, Bêta 3

a guest
Aug 18th, 2015
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.89 KB | None | 0 0
  1. #---------- Variables ----------#
  2. Variables:
  3.     {disguise.sheep.%player%} = false
  4.     {disguise.creeper.%player%} = false
  5.  
  6. #---------- Paramètres & Sécurité ----------#
  7. On join:
  8.     Give a chest named "&6[&eAnimals&6]" to the player
  9.     Display board named "&6[&eAnimals&6]" to player
  10.     Make score "&4Pas d'animal" in board of player to 0
  11.     Move display of player to sidebar
  12.    
  13. On quit:
  14.     Remove every chest named "&6[&eAnimals&6]" from the player
  15.     Set {disguise.sheep.%player%} to false
  16.     Set {disguise.creeper.%player%} to false
  17.     Undisguise player
  18.    
  19. On place of chest:
  20.     If player is holding a chest named "&6[&eAnimals&6]":
  21.         Cancel event
  22.    
  23. On load:
  24.     Broadcast "&6[&eAnimals&6] &aLoaded"
  25.    
  26. On unload:
  27.     Broadcast "&6[&eAnimals&6] &cUnloaded"
  28.  
  29. #---------- Menu ----------#
  30. On rightclick with a chest:
  31.     If player is holding a chest named "&6[&eAnimals&6]":
  32.         Open chest with 1 rows named "&6[&eAnimals&6]" to player
  33.         Wait 1 tick
  34.         Format slot 0 of player with sheep spawn egg named "&7Mouton" to close then run [make player execute command "/disguise sheep"]
  35.         Format slot 1 of player with creeper spawn egg named "&2Creeper" to close then run [make player execute command "/disguise creeper"]
  36.         Format slot 8 of player with 166 named "§4Enlever le déguisement" to close then run [make player execute command "/disguise clear"]  
  37.  
  38.        
  39. #---------- Commandes ----------#
  40. Command /disguise [<text>]:
  41.     Trigger:
  42.         If args 1 is "sheep":
  43.             If {disguise.sheep.%player%} is true:
  44.                 Send "&6[&eAnimals&6] &3Vous êtes déjà déguisé en &7Mouton§3..."
  45.             Else:
  46.                 If {disguise.creeper.%player%} is true:
  47.                     Set {disguise.creeper.%player%} to false
  48.                     Remove every tnt named "&2Boum..." from the player
  49.                 Send "&6[&eAnimals&6] &aVous êtes maintenant déguisé en &7Mouton &a!"
  50.                 Set {disguise.sheep.%player%} to true
  51.                 Disguise player as "sheep"
  52.                 #-- ScoreBoard --#
  53.                 Display board named "&6[&eAnimals&6]" to player
  54.                 Make score "§7Mouton" in board of player to 0
  55.                 Move display of player to sidebar
  56.                
  57.         If args 1 is "creeper":
  58.             If {disguise.creeper.%player%} is true:
  59.                 Send "&6[&eAnimals&6] &3Vous êtes déjà déguisé en &2Creeper§3..."
  60.             Else:
  61.                 If {disguise.sheep.%player%} is true:
  62.                     Set {disguise.sheep.%player%} to false
  63.                 Send "&6[&eAnimals&6] &aVous êtes maintenant déguisé en &2Creeper &a!"
  64.                 Set {disguise.creeper.%player%} to true
  65.                 Disguise player as "creeper"
  66.                 #-- ScoreBoard --#
  67.                 Display board named "&6[&eAnimals&6]" to player
  68.                 Make score "§2Creeper" in board of player to 0
  69.                 Move display of player to sidebar
  70.                 #-- Items --#
  71.                 Give a tnt named "&2Boum..." to the player
  72.                
  73.         If args 1 is "clear":
  74.             Display board named "&6[&eAnimals&6]" to player
  75.             Make score "&4Pas d'animal" in board of player to 0
  76.             Move display of player to sidebar
  77.             If {disguise.sheep.%player%} is true:
  78.                 Send "&6[&eAnimals&6] &5Vous n'êtes plus déguisé."
  79.                 Set {disguise.sheep.%player%} to false
  80.                 Undisguise player
  81.                 stop
  82.             If {disguise.creeper.%player%} is true:
  83.                 Send "&6[&eAnimals&6] &5Vous n'êtes plus déguisé."
  84.                 Remove every tnt named "&2Boum..." from the player
  85.                 Set {disguise.creeper.%player%} to false
  86.                 Undisguise player
  87.                 stop
  88.             Else:
  89.                 Send "&6[&eAnimals&6] &2Vous n'êtes pas déguisé..."
  90.                
  91. #----- Petites Commandes Utiles -----
  92. Command /chest:
  93.     Trigger:
  94.         Give a chest named "&6[&eAnimals&6]" to the player
  95.        
  96. Command /var:
  97.     Trigger:
  98.         Send "{disguise.sheep.%player%} = %{disguise.sheep.%player%}%"
  99.         Send "{disguise.creeper.%player%} = %{disguise.creeper.%player%}%"
  100.        
  101. Command /heal:
  102.     Trigger:
  103.         Heal the player
  104.            
  105. #---------- Effets ----------#
  106.  
  107. #----- Mouton -----#
  108. On rightclick on a grass:
  109.     If {disguise.sheep.%player%} is true:
  110.         If player's food level is smaller than 10:
  111.            Add 1 to hunger of player
  112.            Set the clicked block to dirt
  113.          
  114. On damage:
  115.    If victim is a player:
  116.        If {disguise.sheep.%victim%} is true:
  117.            Play raw sound "mob.sheep.say" at victim with pitch 1 volume 10
  118.          
  119. On damage:
  120.    If victim is a sheep:
  121.        If {disguise.sheep.%attacker%} is true:
  122.            Send "&6[&eAnimals&6] §5Mais c'est ton cousin, ne lui fait pas de mal !" to the attacker
  123.            Cancel event
  124.          
  125. On damage:
  126.    If victim is a player:
  127.        If {disguise.sheep.%attacker%} is true:
  128.            If {disguise.sheep.%victim%} is true:
  129.                Send "&6[&eAnimals&6] §5Mais c'est ton cousin, ne lui fait pas de mal !" to the attacker
  130.                Cancel event
  131.              
  132. #----- Creeper -----#
  133. On rightclick with a tnt:
  134.    If player is holding a tnt named "&2Boum...":
  135.        If {disguise.creeper.%player%} is true:
  136.            Set {_waited} to difference between {creeper.lastexplode.%player%} and now
  137.        If {_waited} is less than 5 seconds:
  138.            Send "&6[&eAnimals&6] &3Tu doit attendre %difference between 5 seconds and {_waited}% avant de pouvoir exploser."
  139.            Stop
  140.        Create explosion of force 3 at player
  141.        Set {creeper.lastexplode.%player%} to now
  142.      
  143. On place of tnt:
  144.    If player is holding a tnt named "&2Boum...":
  145.        If {disguise.creeper.%player%} is true:
  146.            Cancel event
  147.          
  148. On damage:
  149.    If victim is a player:
  150.        If {disguise.creeper.%victim%} is true:
  151.            Play raw sound "mob.creeper.say" at victim with pitch 1 volume 10
  152.          
  153. On damage:
  154.    If damage was caused by block explosion:
  155.        If victim is a player:
  156.            If {disguise.creeper.%victim%} is true:
  157.                Cancel event
  158.                Damage victim by 3.5 hearts
  159.              
  160. On damage:
  161.    If victim is a creeper:
  162.        If {disguise.creeper.%attacker%} is true:
  163.            Cancel event
  164.            Send "&6[&eAnimals&6] §5Mais c'est ton cousin, ne lui fait pas de mal !" to the attacker
  165.  
  166. On damage:
  167.    If victim is a player:
  168.        If {disguise.creeper.%victim%} is true:
  169.            If {disguise.creeper.%attacker%} is true:
  170.                Send "&6[&eAnimals&6] §5Mais c'est ton cousin, ne lui fait pas de mal !" to the attacker
  171.                Cancel event
  172.      
  173. #Addons utilisés : SkQuery, Umbaska, ProtocolLib
Advertisement
Add Comment
Please, Sign In to add comment