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.

Shoot arrow from location to player

Discussion in 'Skript' started by AlexWarrior, Nov 25, 2021.

  1. AlexWarrior

    AlexWarrior Member

    Joined:
    Dec 5, 2020
    Messages:
    11
    Likes Received:
    0
    Hey! So the goal for this skript is to have this ability type item that allows you to create a helper that will stand still and shoot arrows towards the victim

    Skript:
    Code (Text):
    1. on damage:
    2.     if name of tool of attacker is "&c&lArcher Ability":
    3.         create a citizen named "&c&l%attacker%&c&l's &c&lArcher" at attacker's location
    4.        
    5.         set {_npc} to last created citizen
    6.         set {_npclocation} to attacker's location
    7.        
    8.         loop 10 times:
    9.             wait 3 second
    10.            
    11.             set {_loc2} to victim's location
    12.             summon an arrow at {_npclocation}
    13.             set {_arrow} to spawned entity
    14.             set {_vector} to new vector 0, 0, 0
    15.             set velocity of {_arrow} to {_vector}
    16.             shoot {_arrow} from {_npclocation} at speed 5 {_loc2}
    17.        
    18.         remove citizen {_npc}
    No errors but the arrow is spawning in the npc and just landing on the ground, it does not get pushed or sent anywhere.

    Addons:
    Skellet-Legacy
    SkLunar
    SkRayFall

    Is there a better way to do this?

    Thanks.
     
  2. KokoPlayzYT

    KokoPlayzYT Member

    Joined:
    Aug 6, 2021
    Messages:
    14
    Likes Received:
    0
    Yes there is, using the addon skellet you can use:
    Code (Text):
    1. shoot arrow from <location>
    as an example if you want to shot and arrow from the player it will see like that
    Code (Text):
    1. shoot arrow from player
    Hope it helps.
     

Share This Page

Loading...