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.

Setting damage

Discussion in 'Skript' started by Very Cool Bee, Jun 12, 2020.

Thread Status:
Not open for further replies.
  1. Very Cool Bee

    Very Cool Bee New Member

    Joined:
    May 21, 2020
    Messages:
    7
    Likes Received:
    1
    Hello, it's a me. Very Cool Bee.
    I want to change the damage of an iron sword. By default it's damage is 3 hearts and I want it to be a random number between 2.5 and 3.5 and well I don't really know how to do that.
    But maybe you know! :wrong:
     
  2. SkriptLearner

    SkriptLearner Member

    Joined:
    Jul 21, 2019
    Messages:
    45
    Likes Received:
    0
    Hey Very Cool Bee,

    You can set damage with:
    Code (Text):
    1. set the damage to <damage amount>
    More information on this can be found here: http://en.njol.ch/projects/skript/doc/expressions#ExprDamage

    To do what you want you should use this code:
    Code (Text):
    1. on damage:
    2.   damage type is attack
    3.   attacker's tool is iron sword
    4.   set {_damage} to random integer between 2.5 and 3.5
    5.   set the damage to {_damage}
    I hope this helps!
     
  3. Very Cool Bee

    Very Cool Bee New Member

    Joined:
    May 21, 2020
    Messages:
    7
    Likes Received:
    1
    Well it works, but what about the cooldown? I mean wouldn't the pvp with this code work like in 1.8?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...