ProfesseurCraft

Code d'exemple du plugin Skript (les boucles)

Jul 28th, 2014
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #==========================================
  2. # Loop blocks
  3. #==========================================
  4.  
  5. command /blocksInfos:
  6. trigger:
  7. loop blocks in radius 5 around the player:
  8. message "<yellow>%type of loop-block%"
  9.  
  10. command /setBlocks:
  11. trigger:
  12. loop blocks in radius 2 around the player:
  13. set loop-block to stone
  14.  
  15. #==========================================
  16. # Loop entities
  17. #==========================================
  18.  
  19. command /entitiesInfos:
  20. trigger:
  21. loop entities in radius 5 around the player:
  22. message "<yellow>%type of loop-entity%"
  23.  
  24. command /killEntities:
  25. trigger:
  26. loop entities in radius 5 around the player:
  27. kill loop-entity
  28.  
  29. #==========================================
  30. # Loop players
  31. #==========================================
  32.  
  33. command /playersInfos:
  34. trigger:
  35. loop players:
  36. message "<yellow>%name of loop-player%"
  37.  
  38. command /giveItemToPlayer:
  39. trigger:
  40. loop players:
  41. give a diamond to loop-player
  42.  
  43. #==========================================
  44. # Loop list
  45. #==========================================
  46.  
  47. command /addValueToTheList <number>:
  48. trigger:
  49. add number-argument to {list::*}
  50. message "&eLe nombre &f%number-argument% &ea bien été ajoutée !"
  51.  
  52. command /readValuesFromTheList:
  53. trigger:
  54. loop {list::*}:
  55. message "&eIndex : &f%loop-index% - &eValue : &f%loop-value%"
  56.  
  57. command /readValueByIndex <int>:
  58. trigger:
  59. if {list::%int-argument%} exists:
  60. message "&eValeur de l'index %int-argument% : &f%{list::%int-argument%}%"
  61. else:
  62. message "&eL'index &f%int-argument% &en'existe pas dans la liste"
  63.  
  64.  
  65. command /clearList:
  66. trigger:
  67. clear {list::*}
  68. message "<yellow>La liste à bien été vidée"
  69.  
  70. #==========================================
  71. # While
  72. #==========================================
  73.  
  74. command /repeat <int>:
  75. trigger:
  76. set {_i} to 0
  77. while {_i} is smaller than int-argument:
  78. message "<yellow>Je ne dois pas faire de bêtise :D"
  79. set {_i} to {_i}+1
Advertisement
Add Comment
Please, Sign In to add comment