7mm

Skript: Anima-PvP/Minigame

7mm
Mar 10th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. command /timer <number> [<number>] [<boolean>]:
  2. usage: "&d/timer &e<limit&9:int&e> [countdown&9:int&e] [limit-msg&9:bool&e]"
  3. permission: skript.admin
  4. trigger:
  5. if arg 1 is 0:
  6. if {timer.use} is true:
  7. set {timer.use} to false
  8. set {timer.sec} to 0
  9. set {timer.msg} to false
  10. message "&2Success: &asuccess of timer reset."
  11. stop
  12. else:
  13. message "&4Error: &cfailure of timer reset. ('0' is timer reset.)"
  14. else if {timer.use} is true:
  15. message "&4Error: &ctimer is already running. ('0' is timer reset.)"
  16. if arg 1 is less than 1:
  17. message "&4Error: &cplease natural number."
  18. stop
  19. if arg 2 is more than 0:
  20. if arg 3 is true:
  21. message "&2Success: &atimer starting. (countdown: %arg 2%s, message: true)"
  22. set {timer.msg} to true
  23. else:
  24. message "&2Success: &atimer starting. (countdown: %arg 2%s)"
  25. loop arg 2 times:
  26. set {_countdown} to arg 2-loop-number+1
  27. broadcast "&e&l[Timer] &7&o<Count Down> &b%{_countdown}%..."
  28. execute console command "/execute @a ~ ~ ~ playsound block.note.bass master @p"
  29. wait 20 ticks
  30. else:
  31. message "&2Success: &atimer starting."
  32. set {timer.use} to true
  33. set {timer.sec} to arg 1
  34. execute console command "/execute @a ~ ~ ~ playsound block.note.pling master @p"
  35. broadcast "&e&l[Timer] &b&lTimer Starting!"
  36. loop {timer.sec} times:
  37. if {timer.use} is false:
  38. exit loop
  39. execute console command "/title @a actionbar [{""text"":""[Time Left] "",""color"":""gold"",""bold"":true},{""text"":""%{timer.sec}%"",""color"":""aqua"",""bold"":true}]"
  40. wait 20 ticks
  41. remove 1 from {timer.sec}
  42. if {timer.msg} is true:
  43. if {timer.sec} is 180:
  44. broadcast "&e&l[Timer] &dTime Left is &l180s."
  45. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  46. if {timer.sec} is 150:
  47. broadcast "&e&l[Timer] &dTime Left is &l150s."
  48. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  49. if {timer.sec} is 120:
  50. broadcast "&e&l[Timer] &dTime Left is &l120s."
  51. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  52. if {timer.sec} is 90:
  53. broadcast "&e&l[Timer] &dTime Left is &l90s."
  54. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  55. if {timer.sec} is 60:
  56. broadcast "&e&l[Timer] &dTime Left is &l60s."
  57. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  58. if {timer.sec} is 30:
  59. broadcast "&e&l[Timer] &dTime Left is &l30s."
  60. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  61. if {timer.sec} is 20:
  62. broadcast "&e&l[Timer] &dTime Left is &l20s."
  63. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  64. if {timer.sec} is 10:
  65. broadcast "&e&l[Timer] &dTime Left is &l10s."
  66. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  67. if {timer.sec} is 9:
  68. broadcast "&e&l[Timer] &dTime Left is &l9s."
  69. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  70. if {timer.sec} is 8:
  71. broadcast "&e&l[Timer] &dTime Left is &l8s."
  72. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  73. if {timer.sec} is 7:
  74. broadcast "&e&l[Timer] &dTime Left is &l7s."
  75. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  76. if {timer.sec} is 6:
  77. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  78. broadcast "&e&l[Timer] &dTime Left is &l6s."
  79. if {timer.sec} is 5:
  80. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  81. broadcast "&e&l[Timer] &dTime Left is &l5s."
  82. if {timer.sec} is 4:
  83. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  84. broadcast "&e&l[Timer] &dTime Left is &l4s."
  85. if {timer.sec} is 3:
  86. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  87. broadcast "&e&l[Timer] &dTime Left is &l3s."
  88. if {timer.sec} is 2:
  89. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  90. broadcast "&e&l[Timer] &dTime Left is &l2s."
  91. if {timer.sec} is 1:
  92. execute console command "/execute @a ~ ~ ~ playsound ui.button.click master @p"
  93. broadcast "&e&l[Timer] &dTime Left is &l1s."
  94. broadcast "&e&l[Timer] &bTimer Finish."
  95. execute console command "/execute @a ~ ~ ~ playsound entity.generic.burn master @p"
  96. execute console command "/title @a actionbar [{""text"":""[Time Left] "",""color"":""gold"",""bold"":true},{""text"":""0"",""color"":""aqua"",""bold"":true}]"
  97. set {timer.use} to false
  98. set {timer.msg} to false
Advertisement
Add Comment
Please, Sign In to add comment