Set a mobs target

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

Bummy_

New Member
Nov 14, 2019
6
0
0
20
Hello, so I'm trying to set a mobs target to the closest player on the opposite team. Here's the code:

Code:
loop all players in {snd.remainingblue::*}:
    set {_distance} to the distance between player and loop-player
    add {_distance} to {distances.%player%::*}
    set {distance.%{_distance}%} to loop-player
set {closestdistance.%player%} to min({distances.%player%::*})
set the last spawned zombie's target %{distance.%{closestdistance.%player%}}%

The error is with the last line, it says it "Can't understand this condition or effect"
Any and all help is greatly appreciated.
 
For the last line you wouldn't need to put the percentage signs on the variable, so instead put {var} not %{var}%
 
Status
Not open for further replies.