Solved Best killstreak not working

  • 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!

  • 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.

Zyxed

Supporter
May 17, 2021
23
1
3
27
I made command /stats, and the only thing that is not working is best_killstreak. No error when reloading skript.

Code:

Code:
on first join:
    set {ab::%uuid of player%::killstreak} to 0
    set {ab::%uuid of player%::kills_total} to 0
    set {ab::%uuid of player%::deaths} to 0
    set {ab::%uuid of player%::kills} to 0
    set {ab::%uuid of player%::best_killstreak} to 0

on death of player:
    attacker is a player
    victim is a player
    add 1 to {ab::%uuid of attacker%::kills}
    add 1 to {ab::%uuid of victim%::deaths}
    add 1 to {ab::%uuid of attacker%::kills_total}
    add 1 to {ab::%uuid of attacker%::killstreak}
    if {ab::%uuid of attacker%::killstreak} is greater than {ab::%uuid of attacker%::best_killstreak}:
        set {ab::%uuid of attacker%::killstreak} to {ab::%uuid of attacker%::best_killstreak}
    remove 1 from {players.online}
    set {ab::%uuid of victim%::killstreak} to 0

command /stats:
    executable by: players
    trigger:
        send "&8&l------&6&lSinun tilastot&8&l------"
        send "&aKills: &f%{ab::%uuid of player%::kills_total}%"
        send "&cDeaths: &f%{ab::%uuid of player%::deaths}%"
        send "&dK/D: &f%{ab::%uuid of player%::kills_total}/{ab::%uuid of player%::deaths}%"
        send "&6Best Killstreak: &f%{ab::%uuid of player%::best_killstreak}%"
/stats command in game
https://imgur.com/a/ehoIssN
[doublepost=1621579819,1621505344][/doublepost]bump
 
set {ab::%uuid of attacker%::killstreak} to {ab::%uuid of attacker%::best_killstreak}
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:
on first join:
    set {ab::%uuid of player%::killstreak} to 0
    set {ab::%uuid of player%::kills_total} to 0
    set {ab::%uuid of player%::deaths} to 0
    set {ab::%uuid of player%::kills} to 0
    set {ab::%uuid of player%::best_killstreak} to 0
 
on death of player:
    attacker is a player
    victim is a player
    add 1 to {ab::%uuid of attacker%::kills}
    add 1 to {ab::%uuid of victim%::deaths}
    add 1 to {ab::%uuid of attacker%::kills_total}
    add 1 to {ab::%uuid of attacker%::killstreak}
    if {ab::%uuid of attacker%::killstreak} is greater than {ab::%uuid of attacker%::best_killstreak}:
        set {ab::%uuid of attacker%::best_killstreak} to {ab::%uuid of attacker%::killstreak}
    remove 1 from {players.online}
    set {ab::%uuid of victim%::killstreak} to 0
 
command /stats:
    executable by: players
    trigger:
        send "&8&l------&6&lSinun tilastot&8&l------"
        send "&aKills: &f%{ab::%uuid of player%::kills_total}%"
        send "&cDeaths: &f%{ab::%uuid of player%::deaths}%"
        send "&dK/D: &f%{ab::%uuid of player%::kills_total}/{ab::%uuid of player%::deaths}%"
        send "&6Best Killstreak: &f%{ab::%uuid of player%::best_killstreak}%"
 
Status
Not open for further replies.