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 our 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 loc at nearest player

Discussion in 'Skript' started by NonicPvP, Jan 30, 2019.

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

    NonicPvP Member

    Joined:
    Mar 23, 2017
    Messages:
    3
    Likes Received:
    1
    Hello. I can't get this to work, and you are allowed to change what I currently have or you can make a completely new skript for this to work.

    Code (Text):
    1. command /turrettest:
    2.     trigger:
    3.         shoot an arrow from {blueturret.1} at speed 1 nearest player
    4. command /settheturretblue:
    5.     trigger:
    6.         set {blueturret.1} to player's location
    So I need an arrow to be shot from block at location {blueturret.1} at speed 1 towards the nearest player to the block at {blueturret.1}, but I don't know how to do it.
    If you know how, please tell me by leaving a working code! <3 thanks
    --- Double Post Merged, Feb 1, 2019, Original Post Date: Jan 30, 2019 ---
    bump
     
  2. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,354
    Likes Received:
    85
    Medals:
    try
    Code (Text):
    1. command /turrettest:
    2.     trigger:
    3.         loop players in world of {blueturret.1}:
    4.             set {_d::%loop-value%} to distance between loop-value and {blueturret.1}
    5.         set {_l::*} to sorted {_d::*}
    6.         set {_p} to {_l::1}
    7.         {_p} is set
    8.         set {_v} to vector from {blueturret.1} to location of {_p}
    9.         set vector length of {_v} to 1
    10.         shoot an arrow from {blueturret.1} {_v}
    11. command /settheturretblue:
    12.     trigger:
    13.         set {blueturret.1} to player's location
     
    • Like Like x 1
Thread Status:
Not open for further replies.
Loading...