Solved Mobs can’t exit region

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

Cold

Member
May 1, 2022
29
0
1
23
Hello. So I want to create a like thing which makes it so my custom mobs can’t go out of a certain region.

Code:


on damage:
attacker is a zombie
attacker's display name contains "Zombie"
set attacker's final damage to final damage + 6

command /setpos1:
permission: op
trigger:
set {pos1} to player's location

every 10 seconds:
set {zombiecount} to 0 if {zombiecount} is not set
if {zombiecount} < 7:
add 1 to {zombiecount}
spawn 1 zombie at {pos1}
set max health of last spawned zombie to 100
set health of last spawned zombie to 100
set the display name of the last spawned zombie to "&8[&71&8] &cZombie &a%health of last spawned zombie%&7/&a%max health of last spawned zombie%&c❤"
clear the helmet of the last spawned zombie
clear the chestplate of the last spawned zombie
clear the leggings of the last spawned zombie
clear the boots of the last spawned zombie
set tool of last spawned zombie to wooden hoe

on skript start:
set {zombiecount} to 0

on death:
victim is a zombie
victim's display name contains "Zombie"
remove 1 from {zombiecount}
 
Code:
on zombie move:
  teleport event-entity to past event-location if region at event-entity is not "theregionyouwantthemin"
 
Status
Not open for further replies.