damage victim by X doesn't count as death

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

CrimZ0N

Member
Jan 28, 2017
56
3
8
24
Hey lads, sup, I hope you're all doing well during these trying times, I've come to seek help, obviously.

I am not following the given format because I don't need an entire skript, just 2 lines, and the help section from the forum has been removed.

I've a stats skript, which checks the on death event, if the attacker is a player, and if the victim is a player or mob, it credits them a single (or multiple) PVP/PVE kills. However, after creating a damage system in skript, the players no longer get credited for their kills if they kill a mob.

How the damage works is basically it reads from the lore, and deals the damage based on what the item's damage is. I am currently using "damage victim by {_dmgDealt}", and sometimes, if the mob gets one-shot, it doesn't credit the player as the person who killed it, nor does it even consider the player an attacker.

I've tried debugging by doing "on damage" and "on death", then to do "message attacker" however I didn't get a good result.

I've question, is there a way of setting the final damage? I know that you can't set the final damage to anything, and I've tried using metadata but it didn't seem to work either (I may've been doing it wrong), so I'm just wondering if anyone could possibly help? Or is there a way to say "damage victim as attacker for X damage"?

Thanks for readin and I hope you're all safe and sound,
Crimzon.
 
Last edited:
That seems to work, thanks a lot, cheers mate.

Edit: It seemED to work... to some degree. However, I tested it on pigs and cows first. After spawning an entity that had a 100 hearts, I noticed something.

It basically infintely loops itself. No error's, no nothing.

Here's what I am doing
Code:
on damage:
    if attacker is a player:
        make attacker damage victim by 1

Please do note that the 1 was there for testing, I switched it to a different number only to be met with the same result, however what I noticed with 1 and 2 is that if the mob has over 100 hearts, it doesn't die. I am not using a loop, I removed the variables thinking that was the problem, however, it wasn't. Any ideas?
[doublepost=1592908960,1592636754][/doublepost]Bump!
[doublepost=1593093775][/doublepost]B u m p
[doublepost=1593368048][/doublepost]Bump.
[doublepost=1593542518][/doublepost]Guys I really need to solve this, any ideas are welcome, thanks!
[doublepost=1602592436][/doublepost]I still haven't fixed this btw.