Solved increase the damage by % doesn't work

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Mar 29, 2020
28
0
1
29
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:
on damage:
    if name of attacker's tool contains "&1 [Sharp]":
        increase the damage by 50%
 
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:
on damage:
    if name of attacker's tool contains "&1 [Sharp]":
        increase the damage by 50%

Code:
command /test:
  trigger:
    give player diamond sword named "&1 [Sharp]"

on damage:
  if name of attacker's tool contains "&1 [Sharp]":
    set {_highchance} to damage * 0.5
    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 ??
 
Code:
command /test:
  trigger:
    give player diamond sword named "&1 [Sharp]"

on damage:
  if name of attacker's tool contains "&1 [Sharp]":
    set {_highchance} to damage * 0.5
    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 ??

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:
on damage:
  if name of attacker's tool contains "&1 [Sharp]":
    set {_highchance} to damage * 0.5
    increase damage by {_highchance}
 
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:
on damage:
  if name of attacker's tool contains "&1 [Sharp]":
    set {_highchance} to damage * 0.5
    increase damage by {_highchance}
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:
 
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:
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
 
Status
Not open for further replies.