So ive been trying to make a skript where if a player dies he loses a heart and if he lost all his hearts he will get banned but somehow if I use this method:
it gives me an ingame error:
Code:
on death of player:
if attacker is a player:
if health of victim <= 0:
make console execute command: "/kick %victim% reason:&4&l&kHH&c&lYOU LOST ALL OF YOUR HEARTS!!!&4&l&kHH&r"
else:
add 1 to attacker's max health
remove 1 from victim's max health
wait 10 ticks
message "&c&lYou lost a heart due to dying!!!" to victim
message "&a&lYou have gained a heart due to killing %victim%!!!" to attacker
else:
remove 1 from victim's max health
wait 10 ticks
message "&c&lYou lost a heart due to dying!!!" to victim