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.

Solved kill a person skript

Discussion in 'Skript' started by christianmv84, Dec 30, 2017.

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

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    Code (Skript):
    1. on death of player:
    2.     #Projectiles
    3.     if attacker is a player:
    4.         if projectile is set:
    5.             set the death message to "&a%victim% &7fue disparado por &c%attacker% &7con &8[&4%attacker's health%{@Corazon}&8]"
    6.  
    7.     #Mob
    8.     if attacker is a player:
    9.         if attacker is set:
    10.             set the death message to "&a%victim% &7fue asesinado por &c%attacker% &7con &8[&4%attacker's health%{@Corazon}&8]"
    11.  
    12.     #Magic
    13.     if damage was caused by potion:
    14.         set the death message to "&a%victim% &7fue asesinado usando &cmagia"
    15.  
    16.     #Burn
    17.     if damage was caused by burning:
    18.         if victim is player:
    19.             set the death message to "&a%victim% &7murió &cquemado"
    20.             stop
    21.     #Void
    22.     if damage was caused by void:
    23.         if victim is player:
    24.             set the death message to "&a%victim% &7murió por el &cvacio"
    25.             stop
    Ey, i have a problem

    I want that when you throw a person to the void tell the name of the one that has thrown it and count 1 kill to the person who has thrown it and

    The variable kills is {kills.%player%}
     
  2. FinalPlayer024

    FinalPlayer024 Active Member

    Joined:
    Oct 19, 2017
    Messages:
    95
    Likes Received:
    4
    Try saving the "attacker" before the victim fall in the void.
    Maybe with


    Code (Skript):
    1. on damage:
    2.   attacker is a player
    3.   victim is a player
    4.   set {attacker} to the attacker
    5.   set {victim} to the victim
    6.   stop
    7. on death:
    8.   if damage was caused by void:
    9.     victim is a player
    10.     set the death message to "&a%victim% &7cayó gracias a %{attacker}%"
    11.     stop
     
  3. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    but you did not add the variable of kills to the attacker
     
  4. FinalPlayer024

    FinalPlayer024 Active Member

    Joined:
    Oct 19, 2017
    Messages:
    95
    Likes Received:
    4

    Code (Skript):
    1. on damage:
    2.   attacker is a player
    3.   victim is a player
    4.   set {who.killed.me.%victim%} to the attacker
    5.   stop
    6. on death:
    7.   if damage was caused by void:
    8.     victim is a player
    9.     set the death message to "&a%victim% &7cayó gracias a %{who.killed.me.%victim%}%"
    10.     add 1 to {kills.%{who.killed.me.%victim%}%}
    11.     stop
     
    #4 FinalPlayer024, Dec 30, 2017
    Last edited: Jan 1, 2018
  5. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    58
    Sorry, but this isn'T sure! You get maybe a lucky, that someone else get the kills that not hitted the guys. doing this way:

    Code (Skript):
    1. on damage:
    2.     attacker is a player
    3.     victim is a player
    4.     set {Hitted::%victim%} to attacker
    5.     set {Hitted::%attacker%} to victim
    6.     wait 10 seconds
    7.     delete {Hitted::%victim%}
    8.     delete {Hitted::%attacker%}
    9.  
    10. on death:
    11.     if damage was caused by void:
    12.         victim is a player
    13.         if {Hitted::%victim%} is set:
    14.             set death message to "%victim% escape into void with a punch of %{Hitted::%victim%}
    15.            delete {Hitted::%victim%}
    16.        else:
    17.            set death message to "%victim% just jumpend into void!
     
  6. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0

    What happened to the other user works?
     
  7. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    58
    Mine works for other people.
     
  8. FinalPlayer024

    FinalPlayer024 Active Member

    Joined:
    Oct 19, 2017
    Messages:
    95
    Likes Received:
    4
    Now it would work, I edited some lines
     
  9. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    58
    btw just a hint, use next time List Variables, Its very helpful.
     
    • Agree Agree x 1
  10. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    yes but in this where I add the variable

    Code (Skript):
    1. {kills2.%player%}
     
    #10 christianmv84, Jan 1, 2018
    Last edited: Jan 2, 2018
  11. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    58
    Juuuussstt remain, in Damage events you can use only Attacker + Victim!
     
    • Informative Informative x 1
  12. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    Then the variable must be {kills2.%attacker%}?
    --- Double Post Merged, Jan 2, 2018, Original Post Date: Jan 2, 2018 ---
    1 Error: an entity cannot be saved i.e the contents of the variable {hitted::%the attacked entity%}

    Code (Skript):
    1. %{Hitted::%victim%}%
    2. %{Hitted::%attacker%}%
     
    #12 christianmv84, Jan 2, 2018
    Last edited: Jan 2, 2018
  13. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    58
    no clue what youre doing


    add 1 to {kills::%attacker%}
     
  14. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    I think I do not explain what I want to do, I mean what you did to me is fine, the concept but what I want, is that by killing that person who kills him he sucks 1 kill and who dies that he sums a death
     
Thread Status:
Not open for further replies.

Share This Page

Loading...