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.

On shooti

Discussion in 'Skript' started by SammKiller, Dec 16, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. SammKiller

    SammKiller New Member

    Joined:
    Dec 6, 2021
    Messages:
    8
    Likes Received:
    0
    Could someone help me I'm new to the world of skript
    upload_2021-12-16_20-10-12.png



    I wanted to try to do when the player shoots an arrow, the damage will be based on how long the arrow was in the air
     
  2. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    82
    Likes Received:
    8
    here ya go, you can change the timing, and the damage scaling if you want
    Code (Text):
    1. on projectile shoot:
    2.   set {shot::%shooter%} to true
    3.   set {arrow::%shooter%} to last spawned entity
    4.  
    5. on damage:
    6.   if damage cause is projectile:
    7.     if {shot::%shooter%} is true:
    8.       set damage to {arwdmg::%shooter%}
    9.       delete {shot::%shooter%}
    10.       kill {arrow::%shooter%}
    11.       delete {arrow::%shooter%}
    12.  
    13. every 0.5 seconds:
    14.   loop all players:
    15.     if {shot::%loop-player%} is true:
    16.       add 1 to {arwdmg::%loop-player%}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...