Kill Assists system wont work

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

83y

New Member
Nov 7, 2019
8
0
1
20
I've been working on trying to get my kill assists system to work for weeks now and I cant. Can someone either help me or make one for me?

Code:
on damage:
    victim is player
    attacker is player
    add damage to {assists::%victim%::%attacker%}
    # Adds damage to the total amount of damage
    set {_damage} to ({assists::%victim%::%attacker%} - 20)
    # Removes the damage if its more than 0
    if {_damage} >= 0:
        remove {_damage} from {assists::%victim%::%attacker%}

on heal:
    # Sets the players health before the heal
    set {_health} to player's health
    wait a tick
    # Sets the players health after the heal
    set {_health2} to player's health
    # Gets the difference between the health before and after
    set {_heal} to ({_health2} - {_health})
    # Loops all the attackers damage
    loop {assists::%player%::*}:
        # Gets the amount healed and splits it between the attackers.
        set {_remove} to ({_heal} / amount of {assists::%player%::*})
        # If the health gained was more than or equal to 0.5
        if {_remove} >= 0.5:
            remove {_remove} from {assists::%player%::%loop-index%}

on death of player:
    loop {assists::%victim%::*}:
        set {_p} to (loop-index parsed as player)
        set {_percent} to ((((loop-value / victim's max health) * 100) / 2) * 0.15)
    delete {assists::%victim%::*}
 
Status
Not open for further replies.