Solved Tracking kills

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

Amaroa

Member
Sep 30, 2021
2
0
1
23
variables:
{playerskilled} = 0

on kill
add 1 to {playerskilled}

command /stats:
trigger:
message "&7Kills: %{playerskilled}%"

New to skript, familiar with other languages but i cant seem to get this to work? Im doing something wrong if someone could help.
[doublepost=1633040098,1633039988][/doublepost]I just realised on kill isnt a real event, does anybody know the event for kills?
[doublepost=1633040875][/doublepost]Fixed it.
 
variables:
{playerskilled} = 0

on kill
add 1 to {playerskilled}

command /stats:
trigger:
message "&7Kills: %{playerskilled}%"

New to skript, familiar with other languages but i cant seem to get this to work? Im doing something wrong if someone could help.
[doublepost=1633040098,1633039988][/doublepost]I just realised on kill isnt a real event, does anybody know the event for kills?
[doublepost=1633040875][/doublepost]Fixed it.
First, the event is called on death, 2nd, you need to make your variable player based such as {playerkills::%attacker's uuid%}
In death or damage events, you only use attacker and victim, there is no player in that event. 3. You need to specify that the attacker is a player so that you won't create useless variables for random mobs and also specify that the victim is a player so it only counts player kills, if you don't want it to only count player kills, change the `on death of player` to `on death`. And lastly, you need a default value so that if the variable is not set, it'll still show 0 rather than <none>

Code:
on death of player:
    if attacker is a player:
        add 1 to {playerkills::%attacker's uuid%}

command /kills:
    trigger:
        send "&aPlayer kills: &e%{playerkills::%player's uuid%} ? 0%"
 
Status
Not open for further replies.