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 /skriptcomp [<text>] [<text>] [<text>]:
- permission: skript.host
- 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} /skriptcomp &aon&r &7|&r &coff&r"
- message "{@P} /skriptcomp &ereset"
- if arg 1 is "on":
- broadcast "{@P} {@ON}"
- command sender command "/skriptcomp 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 "/skriptcomp 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}%}%"
- on death of a player:
- {Compensation.GameIsGoing} is true
- {Teams::*} is set
- set {_TeamNumber} to {Teams.InTeam::%victim%}
- {_TeamNumber} is set
- set {Compensation.Team.%{_TeamNumber}%.total} to ((size of {Team.%{_TeamNumber}%::*})*10)
- (size of {Team.%{_TeamNumber}%::*}) is more than 1
- # delete {comp::%victim%}
- remove victim from {Team.%{_TeamNumber}%::*}
- command "/team kick %victim%"
- loop {Team.%{_TeamNumber}%::*}:
- set {_Player} to (loop-value parsed as offlineplayer)
- # set {_add} to ({Compensation.Team.%{_TeamNumber}%.total}/(size of {Team.%{_TeamNumber}%::*})-10)
- set {_add} to ((the victim's max health)/(size of {Team.%{_TeamNumber}%::*}))
- # set {_Player}'s max health to ({Compensation.Team.%{_TeamNumber}%.total}/{Compensation.Team.%{_TeamNumber}%.Size})
- set {_Player}'s max health to ({_Player}'s max health + {_add})
- add {_Player} to {Compensation.NeedyForHealth::*}
- add {_add} to {Compensation.%{_Player}%.FutureHealth}
- message "{@P} &eYour compensation regen of %{Compensation.%{_Player}%.FutureHealth}*2% hearts is starting." to {_Player}
- # add floor({_add}/{_Player}'s health) to {Compensation.%{_Player}%.FutureHealth}
- # remove 1 from {Compensation.%{_Player}%.FutureHealth}
- 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
- message "{@P} &eYour compensation regen is complete." to {_Player}
- 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