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!


    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.

Getting the attack damage on an item.

Discussion in 'Skript' started by ApplePenChicken, Jan 17, 2022.

Thread Status:
Not open for further replies.
  1. ApplePenChicken

    Aug 8, 2021
    Likes Received:
    So, I am trying to make a weapon reach script but I want to get the weapon they are holding to work with any weapon. but I need to find out the attack damage to deal to the opponent.

    Code (Text):
    1. on click:
    2.     set {damagee.%player%} to the attack damage of the player's tool
    3.     send "the weapon damage of the player's tool is %{damagee.%player%}%"
    That is an attempt but makes an error.
    Code (Text):
    1. on left click:
    2.     if {reaches.%player%} is true:
    3.         if {reach.%player%} is greater than 3:
    4.             set {_loc} to location of target
    5.             set {_dis} to distance between player and {_loc}
    6.             if {_dis} <= {reach.%player%}:
    7.                    make the player damage the target by 14
    This is the Reach code but that works fine.

    Code (Text):
    1. command /reach <integer> <player>:
    2.     trigger:
    3.         set {reach.%arg-2%} to arg-1
    4.         send "%arg-2% now has %arg-1% Reach"
    This also works and is the code that sets the reach

    Thankyou to whoever helps
Thread Status:
Not open for further replies.

Share This Page