I am making a skript which removes one live from the player. When someone kills a player it's supposed to grant one live to the attacker, yet how do you specify a player in a per person variable?
I am a newbie and I don't really know how to do it. Thanks!
[doublepost=1643493779,1643474821][/doublepost]This was solved on discord!
I am a newbie and I don't really know how to do it. Thanks!
Code:
variables:
{%player%.lives} = 10
on death of player:
remove 1 from {%player%.lives}
message "Straciłeś jedno życię! Pozostało ci %{%player%.lives}% żyć!"
set player's max health to {%player%.lives}
if {%player%.lives} is 0:
send title "&4 %player% został wyeliminowany!" to all players for 5 seconds
player's gamemode is survival
set the player's gamemode to spectator
else:
if attacker is a player:
add 1 to {attacker.lives}