1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Spawning skript

Discussion in 'Skript' started by Julius Ohly, May 14, 2021.

Thread Status:
Not open for further replies.
  1. Julius Ohly

    Julius Ohly Member

    Joined:
    Mar 20, 2021
    Messages:
    19
    Likes Received:
    0
    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
     
  2. varboosted

    varboosted Active Member

    Joined:
    Apr 20, 2020
    Messages:
    50
    Likes Received:
    3
    Hey, you found an answer? I'm also looking for a Skript like this
     
  3. Julius Ohly

    Julius Ohly Member

    Joined:
    Mar 20, 2021
    Messages:
    19
    Likes Received:
    0
    No... i didnt find one, im looking for one...
     
  4. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Something like this should work fine.

    Code (Text):
    1. every 30 seconds:
    2.     set {_areacoordX} to a random integer between -10 and 10
    3.     set {_areacoordY} to 80
    4.     set {_areacoordZ} to a random integer between -10 and 10
    5.     set {_amount} to random integer between 5 and 10  
    6.     loop {_amount} times:
    7.         execute console command "summon zombie %{_areacoordX}% %{_areacoordY}% %{_areacoordZ}%"
     
    #4 SoPastel, May 18, 2021
    Last edited: May 18, 2021
  5. varboosted

    varboosted Active Member

    Joined:
    Apr 20, 2020
    Messages:
    50
    Likes Received:
    3


    Code (Text):
    1. options:
    2.     opZombSpawn: true
    3.     zombHPListener: false
    4.  
    5. on load:
    6.     while {@opZombSpawn} is true:
    7.         set {@zombHPListener} to true
    8.         spawn a zombie at [x coord], [y coord], [z coord] in world "pvp"
    9.         set last spawned zombie's name to "&6%{_h}%&c/&6100 &cHP"
    10.         set last spawned zombie's max health to 100
    11.         set last spawned zombie's health to 100
    12.         wait 30 minutes
    13.     while {@opZombSpawn} is false:
    14.         set {@zombHPListener} to false
    15.         stop
    16.  
    17.     while {@zombHPListener} is true:
    18.         set {_h} to last spawned zombie's health
    19.     while {@zombHPListener} is false:
    20.         stop
    21.  
    22. on death of zombie:
    23.     if event-entity's max health is 100:
    24.         if event-entity is in world "pvp":
    25.             drop 2 golden apples
    26.             drop 1 pink wool named "&dBrain" with lore "&bYummy..."
    [​IMG]
    The zombie does spawn, it shows <none>/100 as the name and doesn't drop anything
    Can you help me fix that please?
     
  6. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Sorry for the late reply, but this should work :emoji_slight_smile::

    Code (Text):
    1. options:
    2.     opZombSpawn: false
    3.  
    4.  
    5. every 30 minutes in "world":
    6.     if {@opZombSpawn} is true:
    7.         set {_h} to 100
    8.         spawn 1 zombie at location (x = -20 , y = 130, z = -20)
    9.         set last spawned zombie's max health to {_h}
    10.         set last spawned zombie's health to {_h}
    11.         set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
    12.  
    13. on damage of zombie:
    14.     if victim's max health is 100:
    15.         set {_h} to (victim's health - damage)
    16.         set name of victim to "&6%{_h}%&c/&6100 &cHP"
    17.  
    18. on death of zombie:
    19.     if event-entity's max health is 100:
    20.         drop 2 golden apple
    21.         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.
     
    #6 SoPastel, May 18, 2021
    Last edited: May 18, 2021
  7. varboosted

    varboosted Active Member

    Joined:
    Apr 20, 2020
    Messages:
    50
    Likes Received:
    3
    Thanks, but the spawning is not working i tried setting it also to true, and also the death drop is not working I think
     
  8. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Is it giving any errors when you run it? I tested it and it worked for me.
     
  9. varboosted

    varboosted Active Member

    Joined:
    Apr 20, 2020
    Messages:
    50
    Likes Received:
    3
    Code (Text):
    1. options:
    2.     opZombSpawn: false
    3.  
    4.  
    5. every 2 minutes in "pvp":
    6.     if {@opZombSpawn} is true:
    7.         set {_h} to 100
    8.         spawn 1 zombie at location (x = -6.425 , y = 148, z = -4.510) in world "pvp"
    9.         set last spawned zombie's max health to {_h}
    10.         set last spawned zombie's health to {_h}
    11.         set name of last spawned zombie to "&6%{_h}%&c/&6100 &cHP"
    12.         broadcast "$a"
    13.         send "ddd" to all players
    14.  
    15. on damage of zombie:
    16.     if victim's max health is 100:
    17.         set {_h} to (victim's health - damage)
    18.         set name of victim to "&6%{_h}%&c/&6100 &cHP"
    19.  
    20. on death of zombie:
    21.     if event-entity's max health is 100:
    22.         drop 2 golden apple
    23.         drop 1 pink wool named "&dBrain" with lore "&bYummy..."
    There isn't any errors, and it is not sending any message
     
  10. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    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 (Text):
    1. options:
    2.     opZombSpawn: true
     
  11. varboosted

    varboosted Active Member

    Joined:
    Apr 20, 2020
    Messages:
    50
    Likes Received:
    3
    Yes, not work?

    skutilities, skript dev36, skellet, skdragon, and for world multiverse-core
    --- Double Post Merged, May 20, 2021, Original Post Date: May 19, 2021 ---
    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?
     
  12. Julius Ohly

    Julius Ohly Member

    Joined:
    Mar 20, 2021
    Messages:
    19
    Likes Received:
    0
    You might wanna add SkQuery or TuSke
     
Thread Status:
Not open for further replies.

Share This Page

Loading...