how to make a zombie attack everyone except a certain 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!

piiinky_

Member
Sep 7, 2024
1
0
1
20
I'm doing an interesting mechanic on the server where small zombies spawn around the player. How can I make a small zombie attack everyone except a certain player?

Here is my script:

on damage:
victim is a player
if {tag::%victim's uuid%} is "Infected":
if attacker is a player or a mob:
if {baby zombie::%victim's uuid%} is not set: # Checking to see if a zombie already exists
set {_loc} to location of victim
add random integer between -2 and 2 to x-coordinate of {_loc}
add random integer between -2 and 2 to z-coordinate of {_loc}
spawn a baby zombie at {_loc}
set {_zombie} to last spawned entity
set {baby zombie::%victim's uuid%} to {_zombie}

send "&cbaby zombie has been spawned!" to victim

# Removing zombie after 1 minute
wait 1 minutes
if {_zombie} is alive:
kill {_zombie}
delete {zombie::%victim's uuid%}
 
I'm doing an interesting mechanic on the server where small zombies spawn around the player. How can I make a small zombie attack everyone except a certain player?

Here is my script:

on damage:
victim is a player
if {tag::%victim's uuid%} is "Infected":
if attacker is a player or a mob:
if {baby zombie::%victim's uuid%} is not set: # Checking to see if a zombie already exists
set {_loc} to location of victim
add random integer between -2 and 2 to x-coordinate of {_loc}
add random integer between -2 and 2 to z-coordinate of {_loc}
spawn a baby zombie at {_loc}
set {_zombie} to last spawned entity
set {baby zombie::%victim's uuid%} to {_zombie}

send "&cbaby zombie has been spawned!" to victim

# Removing zombie after 1 minute
wait 1 minutes
if {_zombie} is alive:
kill {_zombie}
delete {zombie::%victim's uuid%}
You can stop any entity from following a player by using the expression:
on entity target: