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 Best killstreak not working

Discussion in 'Skript' started by Zyxed, May 20, 2021.

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

    Supporter

    Joined:
    May 17, 2021
    Messages:
    23
    Likes Received:
    1
    I made command /stats, and the only thing that is not working is best_killstreak. No error when reloading skript.

    Code:

    Code (Text):
    1.  
    2. on first join:
    3.     set {ab::%uuid of player%::killstreak} to 0
    4.     set {ab::%uuid of player%::kills_total} to 0
    5.     set {ab::%uuid of player%::deaths} to 0
    6.     set {ab::%uuid of player%::kills} to 0
    7.     set {ab::%uuid of player%::best_killstreak} to 0
    8.  
    9. on death of player:
    10.     attacker is a player
    11.     victim is a player
    12.     add 1 to {ab::%uuid of attacker%::kills}
    13.     add 1 to {ab::%uuid of victim%::deaths}
    14.     add 1 to {ab::%uuid of attacker%::kills_total}
    15.     add 1 to {ab::%uuid of attacker%::killstreak}
    16.     if {ab::%uuid of attacker%::killstreak} is greater than {ab::%uuid of attacker%::best_killstreak}:
    17.         set {ab::%uuid of attacker%::killstreak} to {ab::%uuid of attacker%::best_killstreak}
    18.     remove 1 from {players.online}
    19.     set {ab::%uuid of victim%::killstreak} to 0
    20.  
    21. command /stats:
    22.     executable by: players
    23.     trigger:
    24.         send "&8&l------&6&lSinun tilastot&8&l------"
    25.         send "&aKills: &f%{ab::%uuid of player%::kills_total}%"
    26.         send "&cDeaths: &f%{ab::%uuid of player%::deaths}%"
    27.         send "&dK/D: &f%{ab::%uuid of player%::kills_total}/{ab::%uuid of player%::deaths}%"
    28.         send "&6Best Killstreak: &f%{ab::%uuid of player%::best_killstreak}%"
    29.  
    /stats command in game
    https://imgur.com/a/ehoIssN
    --- Double Post Merged, May 21, 2021, Original Post Date: May 20, 2021 ---
    bump
     
  2. Best Answer:
    Post #2 by Tymen van Essen, May 21, 2021
  3. Tymen van Essen

    Joined:
    May 20, 2021
    Messages:
    43
    Likes Received:
    1
    you want to reverse those two.

    as you want to set the best_killstreak to the highest vallue you find for killstreak
    (if you had checked your current killstreak in your command, you would have noticed it should have stayed at 0 as well)


    Code (Text):
    1. on first join:
    2.     set {ab::%uuid of player%::killstreak} to 0
    3.     set {ab::%uuid of player%::kills_total} to 0
    4.     set {ab::%uuid of player%::deaths} to 0
    5.     set {ab::%uuid of player%::kills} to 0
    6.     set {ab::%uuid of player%::best_killstreak} to 0
    7.  
    8. on death of player:
    9.     attacker is a player
    10.     victim is a player
    11.     add 1 to {ab::%uuid of attacker%::kills}
    12.     add 1 to {ab::%uuid of victim%::deaths}
    13.     add 1 to {ab::%uuid of attacker%::kills_total}
    14.     add 1 to {ab::%uuid of attacker%::killstreak}
    15.     if {ab::%uuid of attacker%::killstreak} is greater than {ab::%uuid of attacker%::best_killstreak}:
    16.         set {ab::%uuid of attacker%::best_killstreak} to {ab::%uuid of attacker%::killstreak}
    17.     remove 1 from {players.online}
    18.     set {ab::%uuid of victim%::killstreak} to 0
    19.  
    20. command /stats:
    21.     executable by: players
    22.     trigger:
    23.         send "&8&l------&6&lSinun tilastot&8&l------"
    24.         send "&aKills: &f%{ab::%uuid of player%::kills_total}%"
    25.         send "&cDeaths: &f%{ab::%uuid of player%::deaths}%"
    26.         send "&dK/D: &f%{ab::%uuid of player%::kills_total}/{ab::%uuid of player%::deaths}%"
    27.         send "&6Best Killstreak: &f%{ab::%uuid of player%::best_killstreak}%"
    28.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...