1. 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 comminuty!

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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Victim Condition/Variables

Discussion in 'Skript' started by mxntie, Sep 11, 2021.

Thread Status:
Not open for further replies.
  1. mxntie

    mxntie Member

    Joined:
    Sep 4, 2021
    Messages:
    4
    Likes Received:
    0
    Code (Text):
    1.  variables:
    2.     {%player%.kills} = 0
    3.  
    4. on death:
    5.     if victim is a player:
    6.         add 1 attacker's {%player%.kills}


    If I am being honest, I don't have much experience with skript and I am just trying to learn. Anyone know the solution? Do I have to add some new variable like {%attacker%.kills} just specifically for this?? I really have no idea, sorry for seeming stupid.
     
    #1 mxntie, Sep 11, 2021
    Last edited: Sep 11, 2021
  2. barrybtw

    barrybtw Active Member

    Joined:
    Jun 8, 2021
    Messages:
    82
    Likes Received:
    6
    Don't worry, a few tips, avoid using {nest.variables}, {list::variables} are much better.
    And the
    Code (Text):
    1.  
    2. variables:
    3.     #
    4.  
    section sucks ass, don't use it for anything at all.
     
  3. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    35
    Likes Received:
    3
    Also you should use "victim" on the variable too instead of "player", I think that this is necessary.
    On the death event btw.
    Also just want to let you know that if you dont use uuids and do something like {variable::%victim%} there's a problem, when the player changes their name their stats will reset. Just wanna let you know, I'd do {variable::%victim's uuid%}.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...