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.

Ty so much and u know How to add attacker is a player in this context

Discussion in 'Skript' started by christianmv84, Jan 2, 2018.

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

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    How to add attacker is a player in this context

    Code (Skript):
    1. on death:
    2.     if damage was caused by void:
    3.         victim is a player
    4.         if {Hitted::%victim%} is set:
    5.             set death message to "&a%victim% &7fue tirado al vacio por &c%{Hitted::%victim%}%"
    6.             add 1 to {deaths.%victim%}
    7.         else:
    8.             set death message to "&a%victim% &7se ha tirado al &cvacio"
     
  2. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    Not 100% sure what you mean, but could you not just include "attacker is a player" as you did for the victim?
    Or is something else wrong with the code?
     
  3. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    Sorry me explain, the code is fine I just want to add to the code that

    Code (Skript):
    1. attacker is a player
    2.     add 1 to {kills.%attacker%}
    3.     add 1 to {killstreak.%attacker%}
     
  4. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    Are you just not sure where to put it, is that it? It can go pretty much wherever, bearing in mind the code is executed in the order of top to bottom. if you want it to not stop up your code by making it mandatory the attacker be a player, then make it an "if" statement
    Code (Skript):
    1. if attacker is a player:
    2.     add 1 to {kills.%attacker%}
    3.     add 1 to {killstreak.%attacker%}
     
  5. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    yea thanks! <3 but can u add on my code?

    Code (Skript):
    1. on death:
    2.     if damage was caused by void:
    3.         victim is a player
    4.         if {Hitted::%victim%} is set:
    5.             set death message to "&a%victim% &7fue tirado al vacio por &c%{Hitted::%victim%}%"
    6.             add 1 to {deaths.%victim%}
    7.         else:
    8.             set death message to "&a%victim% &7se ha tirado al &cvacio"
    behind the add 1 to {deaths.%victim%} please
     
  6. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    Put it under "victim is a player"
     
  7. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    Code (Skript):
    1. on death:
    2.     if damage was caused by void:
    3.         victim is a player
    4.     if attacker is a player:
    5.         add 1 to {kills.%attacker%}
    6.         add 1 to {killstreak.%attacker%}
    7.         if {Hitted::%victim%} is set:
    8.             set death message to "&a%victim% &7fue tirado al vacio por &c%{Hitted::%victim%}%"
    9.             add 1 to {deaths.%victim%}
    10.         else:
    11.             set death message to "&a%victim% &7se ha tirado al &cvacio"
    Doesnt work

    When I throw a person in a vacuum it does not work, before
     
  8. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    Provide some more information. Which portion exactly isn't working?
    --- Double Post Merged, Jan 2, 2018, Original Post Date: Jan 2, 2018 ---
    ah, also indent line 4,5 and 6.
    it needs to be under your void condition
     
  9. christianmv84

    christianmv84 Active Member

    Joined:
    Jul 20, 2017
    Messages:
    50
    Likes Received:
    0
    When I throw a person in a vacuum it does not work, before
    When you have a player in a vacuum, he says he died
    --- Double Post Merged, Jan 2, 2018, Original Post Date: Jan 2, 2018 ---
    I throw a player to the void, and he says that I call it empty, but he does not say he was thrown into the void by
     
Thread Status:
Not open for further replies.

Share This Page

Loading...