Applying Damage

Discussion in 'Skript' started by Skzen, Jun 10, 2017.

  1. Hello,

    I'm very new to skript. The damage expression explanation was very confusing for me. How do I do damage that ignores armor and damage that doesn't ignore armor to the player?

    Thanks
     
  2. Find out how much damage each weapon does without armor and just for each weapon set the damage to it. Here is a quick example.

    Code (Text):

    on damage:
        attacker is a player
        if victim doesn't have permission "ignoredamage":
            if attacker's held item is stone sword:
                set damage to 3
     
    This will ignore enchantments so if you have sharpness 1 for example it would be.
    Code (Text):

    on damage:
        attacker is a player
        if victim doesn't have permission "ignoredamage":
            if attacker's held item is stone sword of sharpness 1:
                set damage to 3.5
     
    All of this would ignore critical hits since I don't know how I would check for them.
     
    #2 DMEpepperoni, Jun 10, 2017
    Last edited: Jun 10, 2017
  3. "damage player by 3" or any other number, would do it with armor ignoring, the example by another person above would not ignore armor I think, since it sets damage not final damage. I recommend to ask skript related questions on skunity.com not on spigotmc.org.
     
    #3 Govindas, Jun 10, 2017
    Last edited: Jun 10, 2017
  4. You can check for critical hits by checking if fall distance of attacker is not 0(skellett addon) if it's higher than 0 and player is not in water, ladders etc. then it's a critical hit
     
  5. I tested it right now and you are right. It is a little bit difficult since you need to get all the damage of each weapon and how much damage you take with each armor
     
    • Agree Agree x 1
    • Optimistic Optimistic x 1
  6. Two

    Two

    With skellet skript addon you can do
    Code (Text):
    set final damage to damage
    Final damage is the damage that player receives after all armors protection buffs etc. and in this example you are setting the final damage to the damage that attacker would deal if no armors protection buffs etc. we're applied to the victim.
     
    • Like Like x 2