Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&bCompensation&8]&r
- C: &r
- ON: Enabled by %command sender%!
- OFF: Disabled by %command sender%!
- command /compensation [<text>] [<text>] [<text>]:
- aliases: /compen, /comp
- trigger:
- if arg 1 is not set:
- message "{@P} Coded by Bitlington and Fleft!"
- message "{@C} Compensation has 3 main features:"
- message "{@C} 1. On death of a player, their max hearts are distributed equally among their team."
- if arg 1 is "aps":
- loop all players:
- execute console command "/playsound note.pling %loop-player% ~ ~ ~ 1 1 1"
- if arg 1 is "help" or "?":
- message "{@P} /compensation &aon&r &7|&r &coff&r"
- message "{@P} /compensation &ereset"
- if arg 1 is "on":
- broadcast "{@P} {@ON}"
- command sender command "/compensation aps"
- set {Compensation.GameIsGoing} to true
- loop {Teams::*}:
- set {Compensation.Team.%loop-value-1%.Size} to size of {Team.%loop-value-1%::*}
- loop {Team.%loop-value%::*}:
- set {_player} to ("%loop-value-2%" parsed as offline player)
- set {Compensation.IsAlive.%loop-value-1%} to true
- broadcast "{@P} Team %loop-value%: %{Compensation.Team.%loop-value%.Size}%"
- if arg 1 is "off":
- broadcast "{@P} {@OFF}"
- command sender command "/compensation aps"
- delete {Compensation}
- on consume of golden apple:
- {Compensation.GameIsGoing} is true
- cancel the event
- remove 1 golden apple from the player's inventory
- set {_heal} to the player's max health
- set {_heal} to {_heal} / 2.5
- loop {_heal} times:
- heal the player by 0.5 hearts
- wait 1 second
- on death of a player:
- if {Compensation.GameIsGoing} is true:
- remove player from {Compensation.NeedyForHealth::*}
- set {_maxhearts} to victim's max health
- set {_teamnum} to {Teams.InTeam::%victim%}
- remove 1 from {Compensation.Team.%{_teamnum}%.Size}
- set {_Compensation.AmountToShare.%{_teamnum}%} to ({_maxhearts}/{Compensation.Team.%{_teamnum}%.Size})
- set {Compensation.IsAlive.%victim%} to false
- loop {Team.%{_teamnum}%::*}:
- if {Compensation.IsAlive.%loop-value%} is true:
- set {_Player} to ("%loop-value%" parsed as offlineplayer)
- if {_Player} is online:
- set {_Compensation.Last.MaxHealth.%{_Player}%} to {_Player}'s max health
- set {_Compensation.Last.Health.%{_Player}%} to {_Player}'s max health
- set {_Player}'s max health to {_Compensation.Last.MaxHealth.%{_Player}%}+{_Compensation.AmountToShare.%{_teamnum}%}
- add {_Compensation.AmountToShare.%{_teamnum}%} to {Compensation.%{_Player}%.FutureHealth}
- add {_Player} to {Compensation.NeedyForHealth::*}
- broadcast "%{_Compensation.AmountToShare.%{_teamnum}%}%"
- every 1 second:
- if {Compensation.GameIsGoing} is true:
- loop {Compensation.NeedyForHealth::*}:
- set {_Player} to ("%loop-value%" parsed as offlineplayer)
- if {_Player} is online:
- if {Compensation.%{_Player}%.FutureHealth} is more than 0.5:
- add 0.5 to {_Player}'s health
- subtract 0.5 from {Compensation.%{_Player}%.FutureHealth}
- else:
- remove {_Player} from {Compensation.NeedyForHealth::*}
- set {Compensation.%{_Player}%.FutureHealth} to 0
- on respawn:
- {Compensation.GameIsGoing} is true
- set player's health to 10
- set player's max health to 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement