Solved Target 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.

qKing12

Member
Aug 14, 2018
24
1
0
21
Hello! I want to know how can I make a mob target a certain player.

I tried this:

code_language.skript:
command /target [<player>]:
    trigger:
        spawn slime at player's location
        set last spawned slime's target to arg-1

It does not give an error but also it doesn't work.
 
Hello! I want to know how can I make a mob target a certain player.

I tried this:

code_language.skript:
command /target [<player>]:
    trigger:
        spawn slime at player's location
        set last spawned slime's target to arg-1

It does not give an error but also it doesn't work.
EDIT: Tested with spawning spider (when it's daytime) and it attacked me, so this code should work:

code_language.skript:
command /target <player>:
    trigger:
        spawn slime at player's location
        set the target of last spawned slime to arg-1

Also don't use [<Player>], because it allows the executor to simply ignore the argument-1 and this can cause problems
 
EDIT: Tested with spawning spider (when it's daytime) and it attacked me, so this code should work:

code_language.skript:
command /target <player>:
    trigger:
        spawn slime at player's location
        set the target of last spawned slime to arg-1

Also don't use [<Player>], because it allows the executor to simply ignore the argument-1 and this can cause problems
Hey, thanks for your advice and for your response, I already know that [<player>] make the argument optional but is just for test, I will delete the command after and integrate the code in another command, alsoo it still does not work, it won't go after arg-1, it will attack me.


Oh, I tested it with spider and it works, but won't work for slime.
 
Hey, thanks for your advice and for your response, I already know that [<player>] make the argument optional but is just for test, I will delete the command after and integrate the code in another command, alsoo it still does not work, it won't go after arg-1, it will attack me.
If it still attacks you, I think it's not possible to do with Skript. I'm just tested with spawning a spider.
I think it's only possible when you spawn the slime at the location of the target
Like this:
code_language.skript:
command /target <player>:
    trigger:
        spawn slime at arg-1's location
        set the target of last spawned slime to arg-1
 
If it still attacks you, I think it's not possible to do with Skript. I'm just tested with spawning a spider.
I think it's only possible when you spawn the slime at the location of the target
Like this:
code_language.skript:
command /target <player>:
    trigger:
        spawn slime at arg-1's location
        set the target of last spawned slime to arg-1
Sooo, with slime it won't set the target (send "%last spawned slime's target%" is <none>) and for spider it will hit the target one time and then it will become passive. I still think it's possible with skript, don't know how but still think!
 
Sooo, with slime it won't set the target (send "%last spawned slime's target%" is <none>) and for spider it will hit the target one time and then it will become passive. I still think it's possible with skript, don't know how but still think!
with spider it don't stopped attacking me.
 
with spider it don't stopped attacking me.
At me it will stop if it's daytime. But it does not matter that much, I can make it target multiple times.
[doublepost=1538235140,1538234247][/doublepost]It won't set target for zombie/skeleton/witch either, just for spider
 
At me it will stop if it's daytime. But it does not matter that much, I can make it target multiple times.
[doublepost=1538235140,1538234247][/doublepost]It won't set target for zombie/skeleton/witch either, just for spider
Try my last code I sent. You need to spawn the mob at the target's location
 
Try my last code I sent. You need to spawn the mob at the target's location
I can't 'cause I want the final code to target someone when I right click on an egg and it will be spawned at clicked block's location.
 
Uf, just understand that it will be spawned near a player not the target.
So you rightclick with an egg, that spawns a mob which attacks someone? Or just simply spawns a mob (idk what kind of mob you want)
 
Scholler#6167
I saw the dm, sent u friend request :emoji_stuck_out_tongue:
[doublepost=1538293307,1538236307][/doublepost]bump
still don't know how to do it
[doublepost=1538584697][/doublepost]bump
not giving up on this
[doublepost=1538590154][/doublepost]nevermind, I did it with skript-mirror.
 
Status
Not open for further replies.