Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Skripted by /u/ilom_uk, idea taken from Certamina UHC Season 3.
- #Feel free to edit, but please credit me if you re-release this!
- #Version 1.1
- options:
- perms: skript.op
- prefix: &3[&7UHC&3]&r
- variables:
- #{timedhealing:ghead}= 8
- #{timedhealing:gapple}= 4
- {timedhealing:baseghead}= 8
- {timedhealing:basegapple}= 4
- {timedhealing}= false
- {timedhealing:timer}= 0
- command /timedhealing [<text>] [<text>] [<integer>]:
- aliases: /thealing
- usage: /timedhealing <on:off/reset/gapple/timer> <set> <integer>
- trigger:
- if player has permission "{@perms}":
- if arg-1 is "on" or "enable" or "true":
- if {timedhealing} is false:
- set {timedhealing} to true
- set {timedhealing::timer} to 0
- broadcast "{@prefix} &3Timed Healing &benabled!"
- loop all players:
- command "/playsound note.bass %loop-player% ~ ~ ~ 0.5 1 1"
- else if {timedhealing} is true:
- send "{@prefix} &3Timed Healing is already enabled."
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- if arg-1 is "off" or "disable" or "false":
- if {timedhealing} is true:
- set {timedhealing} to false
- set {timedhealing:timer} to 0
- set {timedhealing:amountremoved} to 0
- set {timedhealing:gapple} to {timedhealing:basegapple}
- broadcast "{@prefix} &3Timed Healing &bdisabled!"
- loop all players:
- command "/playsound note.bass %loop-player% ~ ~ ~ 0.5 1 1"
- else if {timedhealing} is false:
- send "{@prefix} &3Timed Healing is already disabled."
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- if arg-1 is "gapple":
- if arg-2 is "setbase":
- if arg-3 is an integer:
- set {timedhealing:basegapple} to arg-3
- send "{@prefix} &3Golden Apples set to heal a base of %{timedhealing:basegapple}/2% hearts."
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 20:
- send "{@prefix} &7No number higher than 20!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- if arg-2 is "set":
- if arg-3 is an integer:
- set {timedhealing:gapple} to arg-3
- send "{@prefix} &3Golden Apples set to heal %{timedhealing:basegapple}/2% hearts."
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 20:
- send "{@prefix} &7No number higher than 20!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- if arg-2 is "reset":
- set {timedhealing:basegapple} to 4
- set {timedhealing:gapple} to 4
- send "{@prefix} &3Golden Apple healing reset."
- if arg-2 is "resetbase":
- set {timedhealing:basegapple} to 4
- send "{@prefix} &3Golden Apple base healing reset."
- if arg-2 is "reload":
- set {timedhealing:gapple} to {timedhealing:gapple}-{timedhealing:amountremoved}
- if arg-1 is "ghead":
- if arg-2 is "set":
- if arg-3 is an integer:
- set {timedhealing:ghead} to arg-3
- send "{@prefix} &3Golden heads set to heal %{timedhealing:ghead}/2% hearts."
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 20:
- send "{@prefix} &7No number higher than 20!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- if arg-2 is "setbase":
- if arg-3 is an integer:
- set {timedhealing:baseghead} to arg-3
- send "{@prefix} &3Golden heads set to heal a base of %{timedhealing:baseghead}/2% hearts."
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 20:
- send "{@prefix} &7No number higher than 20!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- if arg-2 is "resetbase":
- set {timedhealing:baseghead} to 8
- send "{@prefix} &3Golden Head base healing reset."
- if arg-2 is "reset":
- set {timedhealing:ghead} to 8
- send "{@prefix} &3Golden Head healing reset."
- command "/ghead %{timedhealing:ghead}%"
- if arg-2 is "reload":
- set {timedhealing:ghead} to {timedhealing:baseghead}-{timedhealing:amountremoved}-{timedhealing:gapple}
- command "/ghead %{timedhealing:ghead}% -s"
- send "{@prefix} &3Golden Head healing reloaded."
- if arg-1 is "timer":
- if arg-2 is not set:
- send "{@prefix} &3Timed Healing has been active for %{timedhealing:timer}% minutes.}"
- if arg-2 is "reset":
- set {timedhealing:timer} to 0
- send "{@prefix} &3Timed Healing's timer has been reset."
- if arg-2 is "set":
- if arg-3 is an integer:
- set {timedhealing:timer} to arg-3
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 200:
- send "{@prefix} &7No number higher than 200!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- if arg-1 is "interval":
- if arg-2 is "set":
- if arg-3 is an integer:
- set {timedhealing:interval} to arg-3
- send "{@prefix} &3Timed Healing's interval set to every %{timedhealing:interval}% minutes."
- else if arg-3 is less than 0:
- send "{@prefix} &7No number lower than 0!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-3 is greater than 200:
- send "{@prefix} &7No number higher than 200!" to command sender
- command "/playsound random.break %command sender% ~ ~ ~ 1 0.5 1"
- else if arg-2 is not set:
- send "{@prefix} &3Timed Healing's interval is every %{timedhealing:interval}% minutes."
- if arg-1 is "reset":
- set {timedhealing} to false
- set {timedhealing:timer} to 0
- set {timedhealing:basegapple} to 4
- set {timedhealing:baseghead} to 8
- wait for 1 tick
- set {timedhealing:gapple} to {timedhealing:basegapple}
- set {timedhealing:ghead} to {timedhealing:baseghead}
- set {timedhealing:amountremoved} to 0
- broadcast "{@prefix} &3Golden Apples now heal %{timedhealing:gapple}/2% hearts."
- command "/ghead %{timedhealing:baseghead}% -s"
- loop all players:
- command "/playsound random.break %loop-player% ~ ~ ~ 1 0.5 1"
- broadcast "{@prefix} &3Golden Heads now heal %{timedhealing:ghead}/2% hearts."
- broadcast "{@prefix} &3Timed Healing reset and disabled."
- if arg-1 is "help":
- send "{@prefix} &3/timedhealing [on:off/reset]"
- wait for 1 tick
- send "{@prefix} &3/timedhealing [gapple/timer] [set:reset] [integer]"
- command "/playsound random.pop %command sender% ~ ~ ~ 1 1 1"
- else if arg-1 is not set:
- command "/playsound note.bass %command sender% ~ ~ ~ 0.5 1 1"
- message "{@prefix} &3Golden Apples currently heal %{timedhealing:gapple}/2% hearts."
- wait for 1 tick
- message "{@prefix} &3Golden Heads currently heal %{timedhealing:ghead}/2% hearts."
- wait for 1 tick
- message "{@prefix} &3Admin Commands:"
- wait for 1 tick
- send "{@prefix} &3/timedhealing [on:off/reset]"
- wait for 1 tick
- send "{@prefix} &3/timedhealing [gapple/ghead] [set:setbase:reset] [integer]"
- wait for 1 tick
- send "{@prefix} &3/timedhealing [timer] [set:reset] [integer]"
- else:
- command "/playsound note.bass %command sender% ~ ~ ~ 0.5 1 1"
- message "{@prefix} &3Golden Apples currently heal %{timedhealing:gapple}/2% hearts."
- wait for 1 tick
- message "{@prefix} &3Golden Heads currently heal %{timedhealing:ghead}/2% hearts."
- on consume of golden apple:
- if {timedhealing} is true:
- cancel the event
- remove 1 golden apple from the player
- heal the player by {timedhealing:gapple}/2 hearts
- message "{@prefix} &3Your Golden Apple healed %{timedhealing:gapple}/2% hearts due to Timed Healing."
- wait for 1 tick
- #message "{@prefix} &3...and if it was a Golden Head then it healed %{timedhealing:ghead}/2% hearts due to Timed Healing."
- every minute:
- if {timedhealing} is true:
- add 1 to {timedhealing:timer}
- if {timedhealing:timer} = {timedhealing:interval}:
- set {timedhealing:timer} to 0
- wait for 1 tick
- add 1 to {timedhealing:amountremoved}
- wait for 1 tick
- set {timedhealing:gapple} to {timedhealing:basegapple}-{timedhealing:amountremoved}
- wait for 1 tick
- set {timedhealing:ghead} to {timedhealing:baseghead}-({timedhealing:basegapple}+{timedhealing:amountremoved})
- if {timedhealing:gapple} is less than 1:
- set {timedhealing:gapple} to 1
- broadcast "{@prefix} &3Golden Apples now heal %{timedhealing:gapple}/2% hearts."
- if {timedhealing:ghead} is less than 2:
- set {timedhealing:ghead} to 2
- command "/ghead %{timedhealing:ghead}-1% -s"
- broadcast "{@prefix} &3Golden Heads now heal %{timedhealing:ghead}/2% hearts."
- else if {timedhealing:gapple} is more than 0:
- broadcast "{@prefix} &3Golden Apples now heal %{timedhealing:gapple}/2% hearts."
- loop all players:
- command "/playsound note.pling %loop-player% ~ ~ ~ 1 1 1"
- else if {timedhealing:ghead} is more than 2:
- command "/ghead %{timedhealing:ghead}-1% -s"
- broadcast "{@prefix} &3Golden Heads now heal %{timedhealing:ghead}/2% hearts."
- loop all players:
- command "/playsound note.pling %loop-player% ~ ~ ~ 1 1 1"
- #The End.
Advertisement
Add Comment
Please, Sign In to add comment