how can i summon a zombie with 100hp and in specific location?

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

varboosted

Active Member
Apr 20, 2020
50
3
8
24
how can i summon a zombie with 100hp and in specific location?
and how can i do it each 30 minutes?
 
I haven't tested this yet so if it doesnt work let me know

Code:
options:
    opZombSpawn: true

on load:
    while {@opZombSpawn} is true:
        spawn a zombie named "&cOP Zombie" at [x coord], [y coord], [z coord]
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

In order to disable spawning you'll need to create a command that sets {@opZombSpawn} to false but I'll leave that to you :emoji_slight_smile:
[doublepost=1619541621,1618933906][/doublepost]Was your problem solved?
 
I haven't tested this yet so if it doesnt work let me know

Code:
options:
    opZombSpawn: true

on load:
    while {@opZombSpawn} is true:
        spawn a zombie named "&cOP Zombie" at [x coord], [y coord], [z coord]
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

In order to disable spawning you'll need to create a command that sets {@opZombSpawn} to false but I'll leave that to you :emoji_slight_smile:
[doublepost=1619541621,1618933906][/doublepost]Was your problem solved?
This code does works, but there is an option to make it drop an item and make the name of the zombie as an health or smth?
 
This should work

Code:
options:
    opZombSpawn: true
on load:
    while {@opZombSpawn} is true:
        set {_h} to last spawned zombie's health
        spawn a zombie named "&6%{_h}%&c/&6100 &cHP" at [x coord], [y coord], [z coord]
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        cancel event
        drop 2 golden apples
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Again, I haven't tested it so let me know if there are any problems
 
This should work

Code:
options:
    opZombSpawn: true
on load:
    while {@opZombSpawn} is true:
        set {_h} to last spawned zombie's health
        spawn a zombie named "&6%{_h}%&c/&6100 &cHP" at [x coord], [y coord], [z coord]
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        cancel event
        drop 2 golden apples
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Again, I haven't tested it so let me know if there are any problems

There is 3 errors
upload_2021-4-30_13-15-39.png
 
  • Like
Reactions: Mashhhyyy
Should be fixed now. :emoji_grinning:

Code:
options:
    opZombSpawn: true

on load:
    while {@opZombSpawn} is true:
        set {_h} to last spawned zombie's health
        spawn a zombie at [x coord], [y coord], [z coord]
        set last spawned zombie's name to "&6%{_h}%&c/&6100 &cHP"
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        drop 2 golden apples
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Let me know if there are anymore issues.
 
Should be fixed now. :emoji_grinning:

Code:
options:
    opZombSpawn: true

on load:
    while {@opZombSpawn} is true:
        set {_h} to last spawned zombie's health
        spawn a zombie at [x coord], [y coord], [z coord]
        set last spawned zombie's name to "&6%{_h}%&c/&6100 &cHP"
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        drop 2 golden apples
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Let me know if there are anymore issues.

Hey ty, I've changed the line of spawn a zombie to :
spawn zombie at location at (x = -6.45 , y = 148, z = -4.62) in world "pvp"


and now it works but the hp is not updating
upload_2021-4-30_18-58-57.png
 
  • Like
Reactions: Mashhhyyy
Let's try adding an HP event listener:

Code:
options:
    opZombSpawn: true
    zombHPListener: false

on load:
    while {@opZombSpawn} is true:
        set {@zombHPListener} to true
        spawn a zombie at [x coord], [y coord], [z coord] in world "pvp"
        set last spawned zombie's name to "&6%{_h}%&c/&6100 &cHP"
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        set {@zombHPListener} to false
        stop

    while {@zombHPListener} is true:
        set {_h} to last spawned zombie's health
    while {@zombHPListener} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        if event-entity is in world "pvp":
            drop 2 golden apples
            drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Is it dropping the correct items on death?
 
Let's try adding an HP event listener:

Code:
options:
    opZombSpawn: true
    zombHPListener: false

on load:
    while {@opZombSpawn} is true:
        set {@zombHPListener} to true
        spawn a zombie at [x coord], [y coord], [z coord] in world "pvp"
        set last spawned zombie's name to "&6%{_h}%&c/&6100 &cHP"
        set last spawned zombie's max health to 100
        set last spawned zombie's health to 100
        wait 30 minutes
    while {@opZombSpawn} is false:
        set {@zombHPListener} to false
        stop

    while {@zombHPListener} is true:
        set {_h} to last spawned zombie's health
    while {@zombHPListener} is false:
        stop

on death of zombie:
    if event-entity's max health is 100:
        if event-entity is in world "pvp":
            drop 2 golden apples
            drop 1 pink wool named "&dBrain" with lore "&bYummy..."

Is it dropping the correct items on death?
upload_2021-5-1_20-37-47.png

The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
[doublepost=1621075297,1619890669][/doublepost]
upload_2021-5-1_20-37-47.png

The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
bump
[doublepost=1621261062][/doublepost]
upload_2021-5-1_20-37-47.png

The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
[doublepost=1621075297,1619890669][/doublepost]
bump
bump
 
Status
Not open for further replies.