Advertisement
fleft17

Untitled

Jul 10th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. options:
  2.  
  3. P: &5[StS]&r
  4.  
  5. command /SecondsToSave [<text>] [<number>]:
  6. aliases: /sts
  7. permission: skript.sts
  8. trigger:
  9.  
  10. if arg-1 is "on" or "enable":
  11. if arg-2 is set:
  12. set {sts} to true
  13. set {sts.clear} to a random number between 1 and arg-2
  14. broadcast "{@P} Enabled!"
  15. broadcast "{@P} Game length set to %arg-2% minutes!"
  16. if {sts.clear.number} is not set:
  17. set {sts.clear.number} to 5
  18.  
  19. if arg-2 is not set:
  20. message "{@P} Please specify the length of the game in minutes!"
  21. message "{@P} /sts on [minutes]"
  22.  
  23.  
  24. if arg-1 is "off" or "disable":
  25. delete {sts}
  26. delete {sts.clear}
  27. delete {sts.clear.number}
  28. broadcast "{@P} Disabled!"
  29.  
  30. if arg-1 is "clear":
  31. set {sts.clear.number} to arg-2
  32. broadcast "{@P} You will have %arg-2% seconds to save!"
  33.  
  34. if arg-1 is "start":
  35. if {sts} is not set:
  36. message "{@P} You need to enable StS!"
  37. message "{@P} /sts on"
  38. stop trigger
  39.  
  40. if {sts} is true:
  41. loop {sts.clear} times:
  42. {sts} is true:
  43. wait 1 minute
  44.  
  45. loop {sts.clear.number} times:
  46. {sts} is true:
  47. {sts.clear.number} is greater than 0:
  48. broadcast "{@P} &4&l%{sts.clear.number}%&r seconds to save!"
  49. execute console command "/sts aps"
  50. subtract 1 from {sts.clear.number}
  51. wait 1 second
  52.  
  53. loop all players:
  54. {sts} is true:
  55. clear the loop-player's inventory
  56.  
  57. broadcast "{@P} Inventories cleared!"
  58. wait 5 seconds
  59.  
  60. execute console command "/sts off"
  61.  
  62.  
  63. if arg-1 is "chest" or "chests":
  64.  
  65. if {sts.chest} is not set:
  66. set {sts.chest} to true
  67. broadcast "{@P} Chests enabled!"
  68. stop trigger
  69.  
  70. if {sts.chest} is false:
  71. set {sts.chest} to true
  72. broadcast "{@P} Chests enabled!"
  73. stop trigger
  74.  
  75. if {sts.chest} is true:
  76. set {sts.chest} to false
  77. broadcast "{@P} Chests disabled!"
  78. stop trigger
  79.  
  80. if arg-1 is "aps":
  81. loop all players:
  82. execute console command "/playsound note.pling %loop-player% ~ ~ ~ 1 %a random number between 0.5 and 2% 1"
  83.  
  84.  
  85. on place of chest:
  86. if {sts} is true:
  87. if {sts.chest} is false:
  88. cancel the event
  89. message "{@P} You are not allowed to use chests!"
  90.  
  91. on rightclick:
  92. if {sts} is true:
  93. block is a chest:
  94. if {sts.chest} is false:
  95. cancel the event
  96. message "{@P} You are not allowed to use chests!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement