Shoot arrow from loc at nearest player

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

NonicPvP

New Member
Mar 23, 2017
9
1
3
Denmark
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:
command /turrettest:
    trigger:
        shoot an arrow from {blueturret.1} at speed 1 nearest player
command /settheturretblue:
    trigger:
        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
[doublepost=1549046909,1548875974][/doublepost]bump
 
try
Code:
command /turrettest:
    trigger:
        loop players in world of {blueturret.1}:
            set {_d::%loop-value%} to distance between loop-value and {blueturret.1}
        set {_l::*} to sorted {_d::*}
        set {_p} to {_l::1}
        {_p} is set
        set {_v} to vector from {blueturret.1} to location of {_p}
        set vector length of {_v} to 1
        shoot an arrow from {blueturret.1} {_v}
command /settheturretblue:
    trigger:
        set {blueturret.1} to player's location
 
  • Like
Reactions: Beitrag
Status
Not open for further replies.