Advertisement
fleft17

Untitled

Jul 25th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 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-1%.Size} to size of {Team.%loop-value-1%::*}
  36. loop {Team.%loop-value%::*}:
  37. set {_player} to ("%loop-value-2%" parsed as offline player)
  38. set {Compensation.IsAlive.%loop-value-1%} to true
  39. broadcast "{@P} Team %loop-value%: %{Compensation.Team.%loop-value%.Size}%"
  40.  
  41.  
  42. if arg 1 is "off":
  43. broadcast "{@P} {@OFF}"
  44. command sender command "/compensation aps"
  45. delete {Compensation}
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. on consume of golden apple:
  53. {Compensation.GameIsGoing} is true
  54. cancel the event
  55. remove 1 golden apple from the player's inventory
  56. set {_heal} to the player's max health
  57. set {_heal} to {_heal} / 2.5
  58. loop {_heal} times:
  59. heal the player by 0.5 hearts
  60. wait 1 second
  61.  
  62. on death of a player:
  63. if {Compensation.GameIsGoing} is true:
  64. remove player from {Compensation.NeedyForHealth::*}
  65. set {_maxhearts} to victim's max health
  66. set {_teamnum} to {Teams.InTeam::%victim%}
  67. remove 1 from {Compensation.Team.%{_teamnum}%.Size}
  68. set {_Compensation.AmountToShare.%{_teamnum}%} to ({_maxhearts}/{Compensation.Team.%{_teamnum}%.Size})
  69. set {Compensation.IsAlive.%victim%} to false
  70. loop {Team.%{_teamnum}%::*}:
  71. if {Compensation.IsAlive.%loop-value%} is true:
  72. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  73. if {_Player} is online:
  74. set {_Compensation.Last.MaxHealth.%{_Player}%} to {_Player}'s max health
  75. set {_Compensation.Last.Health.%{_Player}%} to {_Player}'s max health
  76. set {_Player}'s max health to {_Compensation.Last.MaxHealth.%{_Player}%}+{_Compensation.AmountToShare.%{_teamnum}%}
  77. add {_Compensation.AmountToShare.%{_teamnum}%} to {Compensation.%{_Player}%.FutureHealth}
  78. add {_Player} to {Compensation.NeedyForHealth::*}
  79. broadcast "%{_Compensation.AmountToShare.%{_teamnum}%}%"
  80.  
  81. every 1 second:
  82. if {Compensation.GameIsGoing} is true:
  83. loop {Compensation.NeedyForHealth::*}:
  84. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  85. if {_Player} is online:
  86. if {Compensation.%{_Player}%.FutureHealth} is less than 0.5:
  87. add 0.5 to {_Player}'s health
  88. subtract 0.5 from {Compensation.%{_Player}%.FutureHealth}
  89. else:
  90. remove {_Player} from {Compensation.NeedyForHealth::*}
  91. set {Compensation.%{_Player}%.FutureHealth} to 0
  92.  
  93. on respawn:
  94. {Compensation.GameIsGoing} is true
  95. set player's health to 10
  96. set player's max health to 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement