Random Spawning skript

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

Julius Ohly

Member
Mar 20, 2021
19
0
1
23
Soo, i wondered if it would be possible that every 30 seconds; it spawns a random amount of mobs in a random place of an area...

In here i wanna spawn a random amount of mobs between 5-10 in a random place in this specified area....




Would this be possible?

-----------------------------------------------------------------------------------

sk addons i use:
------------------
1:SkQuery
2: skellet
3: TuSke

-----------------------------------------------------------------------------------
ty <3
 
Soo, i wondered if it would be possible that every 30 seconds; it spawns a random amount of mobs in a random place of an area...

In here i wanna spawn a random amount of mobs between 5-10 in a random place in this specified area....




Would this be possible?

-----------------------------------------------------------------------------------

sk addons i use:
------------------
1:SkQuery
2: skellet
3: TuSke

-----------------------------------------------------------------------------------
ty <3
Hey, you found an answer? I'm also looking for a Skript like this
 
Soo, i wondered if it would be possible that every 30 seconds; it spawns a random amount of mobs in a random place of an area...

In here i wanna spawn a random amount of mobs between 5-10 in a random place in this specified area....




Would this be possible?

-----------------------------------------------------------------------------------

sk addons i use:
------------------
1:SkQuery
2: skellet
3: TuSke

-----------------------------------------------------------------------------------
ty <3

Something like this should work fine.

Code:
every 30 seconds:
    set {_areacoordX} to a random integer between -10 and 10
    set {_areacoordY} to 80
    set {_areacoordZ} to a random integer between -10 and 10
    set {_amount} to random integer between 5 and 10  
    loop {_amount} times:
        execute console command "summon zombie %{_areacoordX}% %{_areacoordY}% %{_areacoordZ}%"
 
Last edited:
Something like this should work fine.

Code:
every 30 seconds:
    set {_areacoordX} to a random integer between -10 and 10
    set {_areacoordY} to 80
    set {_areacoordZ} to a random integer between -10 and 10
    set {_amount} to random integer between 5 and 10 
    loop {_amount} times:
        execute console command "summon zombie %{_areacoordX}% %{_areacoordY}% %{_areacoordZ}%"



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..."
upload_2021-5-1_20-37-47-png.6014

The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
Can you help me fix that please?
 
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..."
upload_2021-5-1_20-37-47-png.6014

The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
Can you help me fix that please?

Sorry for the late reply, but this should work :emoji_slight_smile::

Code:
options:
    opZombSpawn: false
 
 
every 30 minutes in "world":
    if {@opZombSpawn} is true:
        set {_h} to 100
        spawn 1 zombie at location (x = -20 , y = 130, z = -20)
        set last spawned zombie's max health to {_h}
        set last spawned zombie's health to {_h}
        set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
 
on damage of zombie:
    if victim's max health is 100:
        set {_h} to (victim's health - damage)
        set name of victim to "&6%{_h}%&c/&6100 &cHP"

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

I feel I should also mention the "max health" is set in hearts, so 100 "max health" is actually 200 hit points and will take 200 damage to deplete.
 
Last edited:
Sorry for the late reply, but this should work :emoji_slight_smile::

Code:
options:
    opZombSpawn: false
 
 
every 30 minutes in "world":
    if {@opZombSpawn} is true:
        set {_h} to 100
        spawn 1 zombie at location (x = -20 , y = 130, z = -20)
        set last spawned zombie's max health to {_h}
        set last spawned zombie's health to {_h}
        set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
 
on damage of zombie:
    if victim's max health is 100:
        set {_h} to (victim's health - damage)
        set name of victim to "&6%{_h}%&c/&6100 &cHP"

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

I feel I should also mention the "max health" is set in hearts, so 100 "max health" is actually 200 hit points and will take 200 damage to deplete.
Thanks, but the spawning is not working i tried setting it also to true, and also the death drop is not working I think
 
Is it giving any errors when you run it? I tested it and it worked for me.
Code:
options:
    opZombSpawn: false
 
 
every 2 minutes in "pvp":
    if {@opZombSpawn} is true:
        set {_h} to 100
        spawn 1 zombie at location (x = -6.425 , y = 148, z = -4.510) in world "pvp"
        set last spawned zombie's max health to {_h}
        set last spawned zombie's health to {_h}
        set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
        broadcast "$a"
        send "ddd" to all players

on damage of zombie:
    if victim's max health is 100:
        set {_h} to (victim's health - damage)
        set name of victim to "&6%{_h}%&c/&6100 &cHP"
 
on death of zombie:
    if event-entity's max health is 100:
        drop 2 golden apple
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."
There isn't any errors, and it is not sending any message
 
Code:
options:
    opZombSpawn: false
 
 
every 2 minutes in "pvp":
    if {@opZombSpawn} is true:
        set {_h} to 100
        spawn 1 zombie at location (x = -6.425 , y = 148, z = -4.510) in world "pvp"
        set last spawned zombie's max health to {_h}
        set last spawned zombie's health to {_h}
        set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
        broadcast "$a"
        send "ddd" to all players

on damage of zombie:
    if victim's max health is 100:
        set {_h} to (victim's health - damage)
        set name of victim to "&6%{_h}%&c/&6100 &cHP"
 
on death of zombie:
    if event-entity's max health is 100:
        drop 2 golden apple
        drop 1 pink wool named "&dBrain" with lore "&bYummy..."
There isn't any errors, and it is not sending any message

Does it not work when "opZombSpawn" is set to "true"? And you are sure the world name matches the correct world. It should be working. What addons do you have installed?

Code:
options:
    opZombSpawn: true
 
Does it not work when "opZombSpawn" is set to "true"? And you are sure the world name matches the correct world. It should be working. What addons do you have installed?

Code:
options:
    opZombSpawn: true
Yes, not work?

skutilities, skript dev36, skellet, skdragon, and for world multiverse-core
[doublepost=1621537906,1621442992][/doublepost]
Does it not work when "opZombSpawn" is set to "true"? And you are sure the world name matches the correct world. It should be working. What addons do you have installed?

Code:
options:
    opZombSpawn: true
Ok I changed the core to Essentials and not my private plugin and it is now spawning the zombie, but there isn't any drop?
 
Yes, not work?

skutilities, skript dev36, skellet, skdragon, and for world multiverse-core
[doublepost=1621537906,1621442992][/doublepost]
Ok I changed the core to Essentials and not my private plugin and it is now spawning the zombie, but there isn't any drop?
You might wanna add SkQuery or TuSke
 
Status
Not open for further replies.