On shooti

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

SammKiller

New Member
Dec 6, 2021
8
0
1
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
 
here ya go, you can change the timing, and the damage scaling if you want
Code:
on projectile shoot:
  set {shot::%shooter%} to true
  set {arrow::%shooter%} to last spawned entity

on damage:
  if damage cause is projectile:
    if {shot::%shooter%} is true:
      set damage to {arwdmg::%shooter%}
      delete {shot::%shooter%}
      kill {arrow::%shooter%}
      delete {arrow::%shooter%}

every 0.5 seconds:
  loop all players:
    if {shot::%loop-player%} is true:
      add 1 to {arwdmg::%loop-player%}
 
Status
Not open for further replies.