Solved How to change a variable for the attacker?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Dipek

Member
Jan 29, 2022
1
0
1
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!

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}
[doublepost=1643493779,1643474821][/doublepost]This was solved on discord!
 
Status
Not open for further replies.