Script: https://pastebin.com/SgaU4iyW
I am trying to create a magic bullet I guess you could say, it’s best if I just explain the idea and how it should work. First, the rules of the bullet:
- will damage each target one time
- will damage the closest player within 10 meters of the last target
So let’s say I have original target (aka target 1) then I have target 2 who is 5 meters away from target 1 and target 3 who is 10 meters from target 2 (so 15 meters from target 1). How this should work is I shoot target 1, then it will damage target 2 and from target 2 it will damage target 3. But, instead, it will damage target 1, then damage target 2, then “end” because there are no avalible targets. This is because of the way I wrote the conditions for targetting, if you read the script the last condition for the transfer rule is making sure that the closest player to the current target is the event player. Target 3 is not the closest player to the current target (target 2), target 1 is.
What I want is a way to find the closest player to the current target that has not been targted already. I don’t know how to specifiy that exactly though.