Advertisement
fleft17

Untitled

Jul 27th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. options:
  2.  
  3. P: &8[&bCompensation&8]&r
  4.  
  5. C: &r
  6.  
  7. ON: Enabled by %command sender%!
  8.  
  9. OFF: Disabled by %command sender%!
  10.  
  11.  
  12.  
  13.  
  14. command /compensation [<text>] [<text>] [<text>]:
  15. aliases: /compen, /comp
  16. trigger:
  17. if arg 1 is not set:
  18. message "{@P} Coded by Bitlington and Fleft!"
  19. message "{@C} Compensation has 3 main features:"
  20. message "{@C} 1. On death of a player, their max hearts are distributed equally among their team."
  21.  
  22. if arg 1 is "aps":
  23. loop all players:
  24. execute console command "/playsound note.pling %loop-player% ~ ~ ~ 1 1 1"
  25.  
  26. if arg 1 is "help" or "?":
  27. message "{@P} /compensation &aon&r &7|&r &coff&r"
  28. message "{@P} /compensation &ereset"
  29.  
  30. if arg 1 is "on":
  31. broadcast "{@P} {@ON}"
  32. command sender command "/compensation aps"
  33. set {Compensation.GameIsGoing} to true
  34. loop {Teams::*}:
  35. set {Compensation.Team.%loop-value%.Size} to size of {Team.%loop-value%::*}
  36. broadcast "{@P} Team %loop-value%: %{Compensation.Team.%loop-value%.Size}%"
  37. loop all players:
  38. set {Compensation.IsAlive.%loop-player%} to true
  39. loop all players:
  40. broadcast "%{Compensation.IsAlive.%loop-player%}%"
  41.  
  42. if arg 1 is "off":
  43. broadcast "{@P} {@OFF}"
  44. command sender command "/compensation aps"
  45. delete {Compensation}
  46. loop all players:
  47. broadcast "%{Compensation.IsAlive.%loop-player%}%"
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. on consume of golden apple:
  55. {Compensation.GameIsGoing} is true
  56. cancel the event
  57. remove 1 golden apple from the player's inventory
  58. set {_heal} to the player's max health
  59. set {_heal} to {_heal} / 2.5
  60. loop {_heal} times:
  61. heal the player by 0.5 hearts
  62. wait 1 second
  63.  
  64. on death of a player:
  65. if {Compensation.GameIsGoing} is true:
  66. remove player from {Compensation.NeedyForHealth::*}
  67. set {_maxhearts} to victim's max health
  68. set {_teamnum} to {Teams.InTeam::%victim%}
  69. remove 1 from {Compensation.Team.%{_teamnum}%.Size}
  70. set {_Compensation.AmountToShare.%{_teamnum}%} to ({_maxhearts}/{Compensation.Team.%{_teamnum}%.Size})
  71. set {Compensation.IsAlive.%victim%} to false
  72. loop {Team.%{_teamnum}%::*}:
  73. if {Compensation.IsAlive.%loop-value%} is true:
  74. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  75. if {_Player} is online:
  76. set {_Compensation.Last.MaxHealth.%{_Player}%} to {_Player}'s max health
  77. set {_Compensation.Last.Health.%{_Player}%} to {_Player}'s max health
  78. set {_Player}'s max health to {_Compensation.Last.MaxHealth.%{_Player}%}+{_Compensation.AmountToShare.%{_teamnum}%}
  79. add {_Compensation.AmountToShare.%{_teamnum}%} to {Compensation.%{_Player}%.FutureHealth}
  80. add {_Player} to {Compensation.NeedyForHealth::*}
  81. broadcast "%{_Compensation.AmountToShare.%{_teamnum}%}%"
  82.  
  83. every 1 second:
  84. if {Compensation.GameIsGoing} is true:
  85. loop {Compensation.NeedyForHealth::*}:
  86. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  87. if {_Player} is online:
  88. if {Compensation.%{_Player}%.FutureHealth} is more than 0.4:
  89. add 0.5 to {_Player}'s health
  90. subtract 0.5 from {Compensation.%{_Player}%.FutureHealth}
  91. else:
  92. remove {_Player} from {Compensation.NeedyForHealth::*}
  93. set {Compensation.%{_Player}%.FutureHealth} to 0
  94.  
  95. on respawn:
  96. {Compensation.GameIsGoing} is true
  97. set player's health to 10
  98. set player's max health to 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement