Advertisement
Guest User

Lockdown - code yellow v.0.1

a guest
Aug 1st, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. # LOCKDOWN code yellow - BLOCK DAMAGE v.0.1
  2.  
  3. # Commands. Il be honist this could have been smaller and with one command but i couldnt get the argument working. I will try to update it at some point.
  4. # lockdown on
  5. command lockdownon:
  6. trigger:
  7. set {lockdown.damage.count} to 1
  8. broadcast "&4&lThe server is in lockdown! Will be unlocked when a admin is online!"
  9. # lockdown off
  10. command lockdownoff:
  11. trigger:
  12. set {lockdown.damage.count} to 0
  13. broadcast "&b&lThe server is out of lockdown!"
  14.  
  15.  
  16.  
  17. # The protection side of things.
  18. on block damage:
  19. player does not have permission "admin"
  20. {lockdown.damage.count} is 1
  21. cancel event
  22. message "&4&lThe server is in lockdown! Will be unlocked when a admin is online!"
  23.  
  24.  
  25. # Makes sure, if you forget to lockdown the server when you leave and the logout failed to lock the server down, this will make sure
  26. # It gets shut down! Better safe then sorry!!
  27. every 120 seconds:
  28. if {lockdown.damage.count} is 0:
  29. number of players is 0
  30. set {lockdown.damage.count} to 1
  31. broadcast "&4&lThe server is in lockdown! Will be unlocked when a admin is online!"
  32.  
  33.  
  34.  
  35. # When you log out and no one is online, it will lock the server down. The broadcast is so you can be assured in the console its locked!
  36. # The 150 delay is just so you dont change
  37. on logout:
  38. wait 150 seconds
  39. number of players is 0
  40. set {lockdown.damage.count} to 1
  41. broadcast "&4&lThe server is in lockdown! Will be unlocked when a admin is online!"
  42.  
  43. # Just to let every one know its locked down (only when some one is online, although it will tell you its locked down
  44. # When you try to smash blocks so feel free to remove if you wish
  45. every 1300 seconds:
  46. number of players is 1
  47. {lockdown.damage.count} is 1
  48. broadcast "&4&lThe server is in lockdown! Will be unlocked when a admin is online!"
  49.  
  50.  
  51. # When you login, it will lift the lockdown if you have permission "admin"
  52. on login:
  53. player has permission "admin"
  54. wait 40 ticks # this is cause it sometimes fails as soon as you log in
  55. if {lockdown.damage.count} is 1:
  56. set {lockdown.damage.count} to 0
  57. message "&b&lLockdown is now disabled!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement