1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

damage victim by X doesn't count as death

Discussion in 'Requests' started by CrimZ0N, Jun 19, 2020.

  1. CrimZ0N

    CrimZ0N Member

    Joined:
    Jan 28, 2017
    Messages:
    55
    Likes Received:
    3
    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.
     
    #1 CrimZ0N, Jun 19, 2020
    Last edited: Jun 19, 2020
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    20
    Code (Skript):
    1. make %living entity% damage %living entity% by %number%
    2.  
    3. set damage to final damage
    4.  
     
    • Agree Agree x 1
  3. CrimZ0N

    CrimZ0N Member

    Joined:
    Jan 28, 2017
    Messages:
    55
    Likes Received:
    3
    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 (Text):
    1. on damage:
    2.     if attacker is a player:
    3.         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?
    --- Double Post Merged, Jun 23, 2020, Original Post Date: Jun 20, 2020 ---
    Bump!
    --- Double Post Merged, Jun 25, 2020 ---
    B u m p
    --- Double Post Merged, Jun 28, 2020 ---
    Bump.
    --- Double Post Merged, Jun 30, 2020 ---
    Guys I really need to solve this, any ideas are welcome, thanks!
     
Loading...