code_language.skript:
command /revivebook:
permission: op
trigger:
give a book named "&b&lRevive Book" to player
on death of player:
remove 1 from {lives.%victim%}
message "&c-1" to victim
give a nether star of unbreaking 1 named "&b&lLife Energy" to attacker
if {lives.%victim%} is 0:
execute console command "/ban %victim% &cYou have lost all of your lives!"
broadcast "&c&l%victim% has lost all of thier lives and been deathbanned!"
add uuid of victim to {bannedplayers::*}
set {_uuid} to uuid of victim
command /fallen:
trigger:
message "%{bannedplayers::*}%" parsed as offline player to player
on right click:
if event-item is book:
if name of event-item is "&b&lRevive Book":
set {Revive::Gui} to a new chest inventory with 6 row with name "&6&lRevive a player"
set {_s} to 0
loop {bannedplayers::*}:
set {_T} to {_uuid} parsed as offline player
set slot {_s} of {Revive::Gui} to {_uuid}'s skull named "&e%{_T}%"
add 1 to {_s}
open {Revive::Gui} to player
set {reviveselected.%{_uuid}%} to false
while {reviveselected.%{_uuid}%} is false:
wait 1 tick
on inventory close:
if event-inventory's name is "&6&lRevive a player":
set {Reviving::%uuid of player%} to false
on inventory click:
if event-inventory's name is "&6&lRevive a player":
cancel event
if event-item is player head:
set {_uuid} to uuid of player
set {reviving::%{_uuid}%} to true
set {reviveselected.%{_uuid}%} to true
close player's inventory
set {_T} to "%event-item's name%"
replace all "&e" with "" in {_T}
replace all "§e" with "" in {_T}
set {_Tplayer} to "%{_T}%" parsed as offline player
set {_uuid} to uuid of {_Tplayer}
remove {_uuid} from {bannedplayers::*}
wait 12 seconds
set {revived.%uuid of {_T}%} to true
set {Reviving::%uuid of player%} to false
set {lives.%{_uuid}%} to 3
unban {_T}
broadcast "&a%{_T}% &fwas ressurected"
on right click:
if event-item is nether star:
if name of event-item is "&b&lLife Energy":
if {lives.%player%} < 12:
add 1 to {lives.%player%}
message "&c+1" to player
remove 1 of event-item from player
else:
message "&4&lYou have reached the maximum amount of lives" to player
command /lives:
trigger:
message "&bYou have %{lives.%player%}% lives left" to player
command /givelives:
permission: op
trigger:
give a nether star of unbreaking 1 named "&b&lLife Energy" to player