I'm new to skripting and I am having a little trouble. The variable doesn't seem to change but it gives hearts over the maximum.
Code:
on join:
if {joins::*} does not contain player's uuid:
add player's uuid to {joins::*}
set {health::%uuid of player%} to 10
on death of player:
if attacker is a player:
if maximum health of attacker <= 200:
if maximum health of victim >= 1:
add 1 to {health::%uuid of attacker%}
set the maximum health of attacker to {health::%uuid of attacker%}
execute console command "/heal %attacker%"
subtract 1 from {health::%uuid of victim%}
set the maximum health of victim to {health::%uuid of victim%}
else:
send "You cant gain hearts from this player"
stop
command /sethearts [<offline player>] [<number>]:
permission: skript.sethearts
trigger:
set {health::%uuid of arg-1%} to arg-2
set the maximum health of arg-1 to {health::%uuid of arg-1%}
message "&6Set %arg-1%'s hearts to %arg-2%"
command /resethearts [<offline player>]:
permission: skript.resethearts
trigger:
set {health::%uuid of arg-1%} to 10
set the maximum health of arg-1 to 10
message "&6Reset %arg-1%'s hearts"
command /hearts [<offline player>]:
permission: skript.hearts
trigger:
message "&6%arg-1% has %{health::%uuid of arg-1%}% hearts"