Creating stackedspawners

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

Wynandus

Member
Aug 23, 2017
15
0
0
24
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_language.skript:
on place of mob spawner:
    if name of player's tool is "&eBlaze &fSpawner":
        loop all blocks in radius 3 around event-block:
            if {loc.%loop-block%.spawner.blaze} is true:
                cancel event
                add 1 to {loc.%loop-block%.amount.blaze}
                delete holo object "%location of loop-block%"
                create holo object "&6&lBlaze Spawner &7(%{loc.%loop-block%.amount.blaze}%x)" with id "%location of loop-block%" at block above loop-block
                stop
            else:
                set {loc.%event-block%.spawner.blaze} to true
                set {loc.%event-block%.amount.blaze} to 1
                create holo object "&6&lBlaze Spawner &7(%{loc.%event-block%.amount.blaze}%x)" with id "%location of event-block%" at block above event-block
                stop
                
on break of mob spawner:
    delete {loc.%event-block%.spawner.blaze}
    delete {loc.%event-block%.amount.blaze}
    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:
87c10c41e9.png

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?
 
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_language.skript:
loop all blocks in radius 3 around event-block:
       if loop-block is a spawner:
           if {loc.%loop-block%.spawner.blaze} is true:
that might fix it.
 
Status
Not open for further replies.