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

Creating stackedspawners

Discussion in 'Skript' started by Wynandus, Dec 6, 2018 at 1:32 AM.

  1. W

    Wynandus Member

    Joined:
    Aug 23, 2017
    Messages:
    15
    Likes Received:
    0
    Hello everyone, so i am trying to create a stackedspawners skript but it hasn't been goining pretty good.
    I'll show you the code and some images in-game, i get no errors upon loading.
    Code (Skript):
    1. on place of mob spawner:
    2.     if name of player's tool is "&eBlaze &fSpawner":
    3.         loop all blocks in radius 3 around event-block:
    4.             if {loc.%loop-block%.spawner.blaze} is true:
    5.                 cancel event
    6.                 add 1 to {loc.%loop-block%.amount.blaze}
    7.                 delete holo object "%location of loop-block%"
    8.                 create holo object "&6&lBlaze Spawner &7(%{loc.%loop-block%.amount.blaze}%x)" with id "%location of loop-block%" at block above loop-block
    9.                 stop
    10.             else:
    11.                 set {loc.%event-block%.spawner.blaze} to true
    12.                 set {loc.%event-block%.amount.blaze} to 1
    13.                 create holo object "&6&lBlaze Spawner &7(%{loc.%event-block%.amount.blaze}%x)" with id "%location of event-block%" at block above event-block
    14.                 stop
    15.                
    16. on break of mob spawner:
    17.     delete {loc.%event-block%.spawner.blaze}
    18.     delete {loc.%event-block%.amount.blaze}
    19.     delete holo object "%location of event-block%"
    (I have not made the on break yet)
    But i was testing on placing down the spawners and then this happend:
    [​IMG]
    Its supposed to stack any spawners that get placed down around a spawner in radius of 3? Could anyone fix this and help me get started?
     
  2. ShaneBee

    Supporter +

    Joined:
    Sep 7, 2017
    Messages:
    1,459
    Likes Received:
    96
  3. L

    Joined:
    Jan 26, 2017
    Messages:
    314
    Likes Received:
    12
    What happed is that if you loop all blocks in radius 3 the first block it finds is the only block it will check. Add
    Code (Skript):
    1.  
    2. loop all blocks in radius 3 around event-block:
    3.        if loop-block is a spawner:
    4.            if {loc.%loop-block%.spawner.blaze} is true:
    5.  
    that might fix it.
     
Loading...