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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved increase the damage by % doesn't work

Discussion in 'Skript' started by nicolas toledo, Jan 19, 2021.

Thread Status:
Not open for further replies.
  1. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    27
    Likes Received:
    0
    Hello I have a problem. I want specific item to damage 50% more based on final damage. Therefore, a weapon that damages 100 should damage 150, but only damages 10 more hearts (110). also with any damage done (if the damage is 15 it also adds 10 damage). The weird thing is that "reduce damage by%" works. Here is the code I am using:

    Code (Text):
    1. on damage:
    2.     if name of attacker's tool contains "&1 [Sharp]":
    3.         increase the damage by 50%
     
  2. Best Answer:
    Post #2 by FireRoz, Jan 21, 2021
  3. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    5
    Code (Text):
    1.  
    2. command /test:
    3.   trigger:
    4.     give player diamond sword named "&1 [Sharp]"
    5.  
    6. on damage:
    7.   if name of attacker's tool contains "&1 [Sharp]":
    8.     set {_highchance} to damage * 0.5
    9.     damage victim by {_highchance} hearts


    i testted it and it should work.
    basically the test command was to give myself the item, the * is multiplication and ya
    stay at school itwill make u a code god ??
     
  4. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    27
    Likes Received:
    0
    Thanks for your answer, it worked !!!, the only change I had to make was to change "damage victim" to "increase damage by". Thank you very much, there are certain code things that I have not learned yet! I did not understand the last thing you told me about school, sorry is that my English is bad: D.
    Code (Text):
    1. on damage:
    2.   if name of attacker's tool contains "&1 [Sharp]":
    3.     set {_highchance} to damage * 0.5
    4.     increase damage by {_highchance}
     
  5. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    134
    Likes Received:
    5
    I am happy I could help.
    I just said that you need to learn to code & please click "best answer" on my post.
    thank u :emoji_slight_smile:
     
  6. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    27
    Likes Received:
    0
    You are the best! Yes, I am learning slowly but I learn, it is a lot of information! thanks again your little code made everything easier
     
Thread Status:
Not open for further replies.

Share This Page

Loading...