Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #Title that is displayed in chat
- title: &4HCF &8|
- #Time how long someone gets banned for dying
- #Default
- bantimedefault: 30 minutes
- #VIP 1 - Permission: hcf.bantime.vip1
- bantimevip1: 20 minutes
- #VIP 2 - Permission: hcf.bantime.vip2
- bantimevip2: 10 minutes
- #VIP 3 - Permission: hcf.bantime.vip3
- bantimevip3: 5 minutes
- #Should deaths be announced to everyone?
- anoudea: true
- on join:
- if player is not alive:
- force player to respawn
- if {hcf::%player's uuid%::ban} is not set:
- set join message to "&8[&a+&8] &a%player%"
- else:
- player has permission "hcf.bantime.vip1":
- set {_bantime} to {@bantimevip1}
- if player has permission "hcf.bantime.vip2":
- set {_bantime} to {@bantimevip2}
- if player has permission "hcf.bantime.vip3":
- set {_bantime} to {@bantimevip3}
- if player doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
- set {_bantime} to {@bantimedefault}
- if difference between {hcf::%player's uuid%::ban} and now is less than {_bantime}:
- set {_time} to difference between {hcf::%player's uuid%::ban} and now
- set {_time} to "%difference between {_time} and {_bantime}%"
- set {_time} to formatTime({_time})
- kick player due to "&cYou are currently banned:%nl%%nl%&7Time remaining: &c%{_time}%%nl%%nl%&7Cause of death: &c%{hcf::%player's uuid%::cause}%"
- else:
- delete {hcf::%player's uuid%::ban}
- delete {hcf::%player's uuid%::cause}
- remove player's uuid from {hcf::deadplayers::*}
- set join message to "&8[ &a+ &8] &a%player%"
- on death:
- victim is a player:
- set {_item} to attacker's tool
- set {hcf::%victim's uuid%::cause} to causeOfDeath("%damage cause%", attacker, {_item})
- set {hcf::%victim's uuid%::ban} to now
- add victim's uuid to {hcf::deadplayers::*}
- set {_cause} to {hcf::%victim's uuid%::cause}
- victim has permission "hcf.bantime.vip1":
- set {_bantime} to {@bantimevip1}
- if victim has permission "hcf.bantime.vip2":
- set {_bantime} to {@bantimevip2}
- if victim has permission "hcf.bantime.vip3":
- set {_bantime} to {@bantimevip3}
- if victim doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
- set {_bantime} to {@bantimedefault}
- set {_time} to "%{_bantime}%"
- set {_time} to formatTime({_time})
- if {@anoudea} = true:
- send action bar "{@title} &c%victim% &7died! &8| &7Reason: &c%{_cause}%" to all players
- wait 5 ticks
- kick victim due to "&cYou died!%nl%%nl%&7You've been banned for: &c%{_time}%%nl%%nl%&7Cause of death: &c%{_cause}%"
- function causeOfDeath(t: text, p: entity, i: itemtype) :: text:
- if {_t} = "lava", "suffocation", "fall", "fire", "burning", "melting", "poison", "wither", "starvation", "lightning", "void", "hitting wall while flying" or "drowning":
- set {_cause} to "%{_t}%" in strict proper case
- else if {_t} = "magma":
- set {_cause} to "&cMagma Block"
- else if {_t} = "contact":
- set {_cause} to "&cCactus"
- else if {_t} = "falling block":
- set {_cause} to "&cAnvil"
- else if {_t} = "attack", "sweep attack", "projectile", "potion", "thorns" or "entity explosion":
- set {_attacker} to "%{_p}%" in strict proper case
- if {_i} is not air:
- set {_attackerstool} to "%{_i}%" in strict proper case
- else:
- set {_attackerstool} to "Hands"
- if {_attackerstool} is not "<none>":
- {_p} is a player:
- set {_cause} to "&c%{_attacker}% &7with &c%{_attackerstool}%"
- else:
- set {_cause} to "&c%{_attacker}%"
- else:
- if {_attacker} is not "<none>":
- set {_cause} to "&c%{_attacker}%"
- if "%{_cause}%" contains "Area":
- set {_cause} to "&cDragon's Breath"
- else:
- set {_cause} to {_t} in strict proper case
- set {_cause} to "%{_cause}% &8(Dispenser)"
- else:
- set {_cause} to "%{_t}%" in strict proper case
- return {_cause}
- on quit:
- if {hcf::%player's uuid%::ban} is set:
- set leave message to ""
- else:
- set leave message to "&8[&c-&8] &c%player%"
- command /revive [<offlineplayer>]:
- trigger:
- player has permission "hcf.revive":
- if arg 1 is not set:
- if size of {hcf::deadplayers::*} > 0:
- send "{@title} &7List of all currently dead players: &8&o(%size of {hcf::deadplayers::*}%&8&o)"
- send " "
- loop {hcf::deadplayers::*}:
- loop-value has permission "hcf.bantime.vip1":
- set {_bantime} to {@bantimevip1}
- set {_perm} to "VIP 1"
- set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip1}%"
- if loop-value has permission "hcf.bantime.vip2":
- set {_bantime} to {@bantimevip2}
- set {_perm} to "VIP 2"
- set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip2}%"
- if loop-value has permission "hcf.bantime.vip3":
- set {_bantime} to {@bantimevip3}
- set {_perm} to "VIP 3"
- set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip3}%"
- if loop-value doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
- set {_bantime} to {@bantimedefault}
- set {_perm} to "Default"
- set {_reduction} to "None"
- if difference between {hcf::%loop-value%::ban} and now is less than {_bantime}:
- set {_timeremain} to difference between {hcf::%loop-value%::ban} and now
- set {_timeremain} to "%difference between {_timeremain} and {_bantime}%"
- set {_timeremain} to formatTime({_timeremain})
- set {_timedisplay} to "&c[⌚]"
- else:
- set {_timeremain} to "&aWaiting for join..."
- set {_timedisplay} to "&a[⌚]"
- send formatted "&c○ &7%loop-value parsed as offlineplayer% &8| <ttp:&eRevive &7%loop-value parsed as offlineplayer%><cmd:/revive %loop-value parsed as offlineplayer%>&e[❤]<reset> &8| <ttp:&7Cause of death: &c%{hcf::%loop-value%::cause}%>&c[☠]<reset> &7- <ttp:&7Time remaining: &c%{_timeremain}%>%{_timedisplay}%<reset> &8| <ttp:&7Time reduction: <##80cee1>%{_reduction}% &8| &7Perm: <##80cee1>%{_perm}%><##80cee1>[☘]<reset>"
- else:
- send "{@title} &7Seems like noone died yet."
- else:
- if {hcf::%arg 1's uuid%::ban} is set:
- delete {hcf::%arg 1's uuid%::*}
- send "{@title} &7You revived &c%arg 1%&7!"
- remove arg 1's uuid from {hcf::deadplayers::*}
- else:
- send "{@title} &7Seems like &c%arg 1% &7hasn't died yet!"
- else:
- send "{@title} &cYou don't have the required permission to use this command!"
- function formatTime(t: text) :: text:
- replace " seconds" in {_t} with "s"
- replace " minutes" in {_t} with "m"
- replace " hours" in {_t} with "h"
- replace " days" in {_t} with "d"
- replace " second" in {_t} with "s"
- replace " minute" in {_t} with "m"
- replace " hour" in {_t} with "h"
- replace " day" in {_t} with "d"
- replace " and", " and " and "and " in {_t} with ""
- return {_t}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement