Guest User

Code Source Animals, Bêta 2

a guest
Aug 18th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.04 KB | None | 0 0
  1. #---------- Variables ----------#
  2.  
  3. Variables:
  4.     {disguise.sheep.%player%} = false
  5.  
  6. #---------- Paramètres ----------#
  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]" to the player
  15.     Set {disguise.sheep.%player%} to false
  16.     Undisguise player
  17.  
  18. On place of chest:
  19.     If player is holding a chest named "&6[&eAnimals&6]":
  20.         Cancel event
  21.  
  22. On load:
  23.     Broadcast "&6[&eAnimals&6] &aLoaded"
  24.  
  25. On unload:
  26.     Broadcast "&6[&eAnimals&6] &cUnloaded"
  27.  
  28. #---------- Menu ----------#
  29. On rightclick with a chest:
  30.     If player is holding a chest named "&6[&eAnimals&6]":
  31.         Open chest with 1 rows named "&6[&eAnimals&6]" to player
  32.         Wait 1 tick
  33.         Format slot 0 of player with white wool named "&7Mouton" to close then run [make player execute command "/disguise sheep"]
  34.         Format slot 8 of player with 166 named "§4Enlever le déguisement" to close then run [make player execute command "/disguise clear"]
  35.  
  36.    
  37. #---------- Commandes ----------#
  38. Command /disguise [<text>]:
  39.     Trigger:
  40.         If args 1 is "sheep":
  41.             If {disguise.sheep.%player%} is true:
  42.                 Send "&6[&eAnimals&6] &3Vous êtes déjà déguisé en &7Mouton§3..."
  43.             Else:
  44.                 Send "&6[&eAnimals&6] &aVous êtes maintenant déguisé en &7Mouton &a!"
  45.                 Set {disguise.sheep.%player%} to true
  46.                 Disguise player as "sheep"
  47.                 #-- ScoreBoard --#
  48.                 Display board named "&6[&eAnimals&6]" to player
  49.                 Make score "§7Mouton" in board of player to 0
  50.                 Move display of player to sidebar
  51.         If args 1 is "clear":
  52.             Display board named "&6[&eAnimals&6]" to player
  53.             Make score "&4Pas d'animal" in board of player to 0
  54.             Move display of player to sidebar
  55.             If {disguise.sheep.%player%} is true:
  56.                 Send "&6[&eAnimals&6] &5Vous n'êtes plus déguisé."
  57.                 Set {disguise.sheep.%player%} to false
  58.                 Undisguise player
  59.             Else:
  60.                 Send "&6[&eAnimals&6] &2Vous n'êtes pas déguisé..."
  61.            
  62.  
  63. Command /chest:
  64.     Trigger:
  65.         Give a chest named "&6[&eAnimals&6]" to the player
  66.        
  67. #---------- Effets ----------#
  68.  
  69. #----- Mouton -----#
  70. On rightclick on a grass:
  71.     If {disguise.sheep.%player%} is true:
  72.         If player's food level is smaller than 10:
  73.            Add 1 to hunger of player
  74.            Set the clicked block to dirt
  75.      
  76. On damage:
  77.    If {disguise.sheep.%victim%} is true:
  78.        Play raw sound "mob.sheep.say" at victim with pitch 1 volume 10
  79.      
  80. On damage:
  81.    If victim is a sheep:
  82.        If {disguise.sheep.%attacker%} is true:
  83.            Send "&6[&eAnimals&6] §5Mais c'est ton cousin, ne lui fait pas de mal !" to the attacker
  84.            Cancel event
Advertisement
Add Comment
Please, Sign In to add comment