Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Select Armor skript by Ilom.
- options:
- P: &7[&8Select Armor&7]&c
- shortp: &7[&8UHC&7]&c
- # iron.amount: 8
- # diamond.amount: 2
- command /selectarmor [<text>] [<text>] [<integer>]:
- aliases: /selectarmour
- trigger:
- if command sender has permission "uhc.host":
- if arg-1 is set:
- if arg 1 is "enable":
- set {selectarmor} to true
- broadcast "{@P} &cSelect Armor &aenabled &cby &9%command sender%"
- if arg 1 is "disable":
- delete {selectarmor}
- broadcast "{@P} &cSelect Armor &4disabled &cby &9%command sender%"
- if arg-1 is "reset":
- loop all players:
- set {selectarmor.diamond.%player%} to 0
- set {selectarmor.iron.%player%} to 0
- delete {selectarmor}
- set {diamond.amount} to 2
- set {iron.amount} to 8
- broadcast "{@shortp} &7Select Armor &creset & disabled &7by &9%command sender%"
- if arg-1 is "me":
- send "{@P} &cYou have crafted &4%{selectarmor.iron.%player%}% &cpieces of &8iron armor."
- wait for 1 tick
- send "{@P} &cYou have crafted &4%{selectarmor.diamond.%player%}% &cpieces of &9diamond armor."
- wait for 1 tick
- send "{@P} &cYou can craft up to &4%{iron.amount}% &cpieces of &8iron armor&c, and &4%{diamond.amount}% &cpieces of &9diamond armor."
- if arg-1 is "iron":
- if arg-2 is not set:
- send "{@P} &cAmount of iron armor pieces currently craftable is &4%{iron.amount}%."
- if arg-2 is "set":
- if arg-3 is an integer:
- set {iron.amount} to arg-3
- broadcast "{@P} &cAmount of iron armor pieces craftable set to &4%{iron.amount}% &cby &9%command sender%."
- if arg-2 is "reset":
- set {iron.amount} to 8
- broadcast "{@P} &cAmount of iron armor pieces craftable reset to &48 &cby &9%command sender%."
- if arg-1 is "diamond":
- if arg-2 is not set:
- send "{@P} &cAmount of diamond armor pieces currently craftable is &4%{amount.diamond}%."
- if arg-2 is "set":
- if arg-3 is an integer:
- set {diamond.amount} to arg-3
- broadcast "{@P} &cAmount of diamond armor pieces craftable set to &4%{amount.diamond}% &cby &9%command sender%."
- if arg-2 is "reset":
- set {diamond.amount} to 8
- broadcast "{@P} &cAmount of diamond armor pieces craftable reset to &48 &cby &9%command sender%."
- if arg-1 is set:
- if arg-2 is "iron":
- if arg-3 is an integer:
- set {selectarmor.iron.%arg-1%} to arg-3
- send "{@P} Amount of iron armor crafted by &4%arg-1% &cset to &4%arg-3%."
- if arg-2 is "diamond":
- if arg-3 is an integer:
- set {selectarmor.diamond.%arg-1%} to arg-3
- send "{@P} Amount of diamond armor crafted by &4%arg-1% &cset to &4%arg-3%."
- if arg-1 is "clearall":
- loop all players:
- set {selectarmor.diamond.%loop-player%} to 0
- set {selectarmor.iron.%loop-player%} to 0
- broadcast "{@P} All armor crafted cleared by &9%command sender%."
- if arg-1 is "clear":
- if arg-2 is set:
- set {selectarmor.diamond.%arg-2%} to 0
- set {selectarmor.iron.%arg-2%} to 0
- send "{@P} Armor crafted by &9%arg-2% &ccleared." to command sender
- if arg-1 is "help":
- send "{@P} /selectarmor enable - Enable Select Armor."
- wait for 1 tick
- send "{@P} /selectarmor disable - Disable Select Armor."
- wait for 1 tick
- send "{@P} /selectarmor reset - Reset and disable Select Armor."
- wait for 1 tick
- send "{@P} /selectarmor iron - Set the amount of iron armor craftable."
- wait for 1 tick
- send "{@P} /selectarmor diamond - Set the amount of diamond armor craftable."
- wait for 1 tick
- send "{@P} /selectarmor [playername] - Set the amount of armor players have crafted."
- wait for 1 tick
- send "{@P} /selectarmor me - See how much armor you can craft."
- wait for 1 tick
- send "{@P} /selectarmor clear - Clear amounts of armor crafted by an individual player."
- wait for 1 tick
- send "{@P} /selectarmor clearall - Clear all amounts of armor crafted."
- wait for 1 tick
- send "{@P} /selectarmor help - View Select Armor's commands."
- else if arg-1 is not set:
- send "{@P} /selectarmor enable - Enable Select Armor"
- wait for 1 tick
- send "{@P} /selectarmor disable - Disable Select Armor."
- wait for 1 tick
- send "{@P} /selectarmor reset - Reset and disable Select Armor."
- wait for 1 tick
- send "{@P} /selectarmor iron - Set the amount of iron armor craftable."
- wait for 1 tick
- send "{@P} /selectarmor diamond - Set the amount of diamond armor craftable."
- wait for 1 tick
- send "{@P} /selectarmor [playername] - Set the amount of armor players have crafted."
- wait for 1 tick
- send "{@P} /selectarmor me - See how much armor you can craft."
- wait for 1 tick
- send "{@P} /selectarmor clear - Clear amounts of armor crafted by an individual player."
- wait for 1 tick
- send "{@P} /selectarmor clearall - Clear all amounts of armor crafted."
- wait for 1 tick
- send "{@P} /selectarmor help - View Select Armor's commands."
- else:
- send "{@P} &cYou have crafted &4%{selectarmor.iron.%player%}% &cpieces of &8iron armor."
- wait for 1 tick
- send "{@P} &cYou have crafted &4%{selectarmor.diamond.%player%}% &cpieces of &9diamond armor."
- wait for 1 tick
- send "{@P} &cYou can craft up to &4%{iron.amount}% &cpieces of &8iron armor&c, and &4%{diamond.amount}% &cpieces of &9diamond armor."
- on craft:
- if {selectarmor} is true:
- if item is iron chestplate or iron leggings or iron boots or iron helmet:
- if {selectarmor.iron.%player%} is set:
- if {selectarmor.iron.%player%} is less than {iron.amount}:
- add 1 to {selectarmor.iron.%player%}
- if {selectarmor.iron.%player%} is {iron.amount}:
- send "{@shortp} &cYou can no longer craft iron armor."
- else:
- cancel the event
- send "{@shortp} &cYou have already crafted %{iron.amount}% iron armor pieces."
- else:
- set {selectarmor.iron.%player%} to 1
- if item is diamond chestplate or diamond leggings or diamond boots or diamond helmet:
- if {selectarmor.diamond.%player%} is set:
- if {selectarmor.diamond.%player%} is less than {diamond.amount}:
- add 1 to {selectarmor.diamond.%player%}
- if {selectarmor.diamond.%player%} is {diamond.amount}:
- send "{@shortp} &cYou can no longer craft diamond armor."
- else:
- cancel the event
- send "{@shortp} &cYou have already crafted %{diamond.amount}% diamond armor pieces."
- else:
- set {selectarmor.diamond.%player%} to 1
- #This part is mainly for PvP arenas, feel free to comment out/remove
- on death of player:
- if {selectarmor} is true:
- set {selectarmor.iron.%victim%} to 0
- set {selectarmor.diamond.%victim%} to 0
- message "{@shortp} You died, your amount of armor crafted has been reset." to the victim
Advertisement
Add Comment
Please, Sign In to add comment