Solved On kill with bow?

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

Nexurant

New Member
Jun 12, 2019
7
0
0
24
Hey, I've been looking for a while and I am unable to find an answer. I'm working on a missions skript, and one of the missions is to get a kill with a bow. How would I make it so that on death it checks if the player used a bow to kill them? I've given a code which doesn't work but roughly shows what I would like it to do. Also, players can kill themselves and it counts towards it. How can I fix that too?

Code:
on death:
    victim is a player
    damager is a player
    if the damager's weapon is a bow:
        add 1 to {bowkills.%damager%}
        message "&dMissions &8| &7+1 Archer Kill" to the damager
    else:
        message "&dMissions &8| &7You didn't use a bow!" to the damager

Thank you :emoji_slight_smile:
 
code_language.skript:
on death:
    victim is a player
    attacker is a player
    attacker is not victim
    if "%damage cause%" is "projectile":
        add 1 to {bowkills.%attacker%}
        message "&dMissions &8| &7+1 Archer Kill" to attacker
    else:
        message "&dMissions &8| &7You didn't use a bow!" to attacker
 
Last edited:
Reloads with no errors, but when I kill someone with a bow, it displays the "You didn't use a bow" message.
 
Status
Not open for further replies.