Advertisement
Ilom_uk

Broken AF Comp Skript

Feb 1st, 2018
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 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 /skriptcomp [<text>] [<text>] [<text>]:
  15. permission: skript.host
  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} /skriptcomp &aon&r &7|&r &coff&r"
  28. message "{@P} /skriptcomp &ereset"
  29.  
  30. if arg 1 is "on":
  31. broadcast "{@P} {@ON}"
  32. command sender command "/skriptcomp 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 "/skriptcomp 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. on death of a player:
  82. {Compensation.GameIsGoing} is true
  83. {Teams::*} is set
  84. set {_TeamNumber} to {Teams.InTeam::%victim%}
  85. {_TeamNumber} is set
  86. set {Compensation.Team.%{_TeamNumber}%.total} to ((size of {Team.%{_TeamNumber}%::*})*10)
  87. (size of {Team.%{_TeamNumber}%::*}) is more than 1
  88. # delete {comp::%victim%}
  89. remove victim from {Team.%{_TeamNumber}%::*}
  90. command "/team kick %victim%"
  91. loop {Team.%{_TeamNumber}%::*}:
  92. set {_Player} to (loop-value parsed as offlineplayer)
  93. # set {_add} to ({Compensation.Team.%{_TeamNumber}%.total}/(size of {Team.%{_TeamNumber}%::*})-10)
  94. set {_add} to ((the victim's max health)/(size of {Team.%{_TeamNumber}%::*}))
  95. # set {_Player}'s max health to ({Compensation.Team.%{_TeamNumber}%.total}/{Compensation.Team.%{_TeamNumber}%.Size})
  96. set {_Player}'s max health to ({_Player}'s max health + {_add})
  97. add {_Player} to {Compensation.NeedyForHealth::*}
  98. add {_add} to {Compensation.%{_Player}%.FutureHealth}
  99. message "{@P} &eYour compensation regen of %{Compensation.%{_Player}%.FutureHealth}*2% hearts is starting." to {_Player}
  100.  
  101. # add floor({_add}/{_Player}'s health) to {Compensation.%{_Player}%.FutureHealth}
  102. # remove 1 from {Compensation.%{_Player}%.FutureHealth}
  103.  
  104. every 1 second:
  105. if {Compensation.GameIsGoing} is true:
  106. loop {Compensation.NeedyForHealth::*}:
  107. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  108. if {_Player} is online:
  109. if {Compensation.%{_Player}%.FutureHealth} is more than 0.5:
  110. add 0.5 to {_Player}'s health
  111. subtract 0.5 from {Compensation.%{_Player}%.FutureHealth}
  112. else:
  113. remove {_Player} from {Compensation.NeedyForHealth::*}
  114. set {Compensation.%{_Player}%.FutureHealth} to 0
  115. message "{@P} &eYour compensation regen is complete." to {_Player}
  116.  
  117. on respawn:
  118. {Compensation.GameIsGoing} is true
  119. # set player's health to 10
  120. set player's max health to 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement