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%::*}