Gate/Well Dispenser

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

Shroomz

Supporter +
Jun 22, 2017
44
0
6
25
Suggested name: Fence Dispenser

What I want:
I was skripting for my friend. He wanted mechanical gate skript.. Dispensers that generate fence .. so it works as gate. The problem I came across is that it only generates 8 block tall gates and if the distance between dispenser and dirt (or other block) is less than 8 it will break this skript...

So the thing I would like to do is this same skript but it would carry logs and cauldron with it and would continue through water. the gate would only stop when the fence touches dirt/land or there is no longer fence inside dispenser. and once dispenser is again activated it would take fence back!

I know this original one is a mess... Please help me.
code_language.skript:
On Dispensing of fence:
    cancel event
    set {eventblock.%location%} to location of event-block
    if block under {eventblock.%location%} is air:
        wait 0.5 second
        set block at block under {eventblock.%location%} to fence
        if block under block under {eventblock.%location%} is air:
            wait 0.5 second
            set block at block under block under {eventblock.%location%} to fence
            if block under block under block under {eventblock.%location%} is air:
                wait 0.5 second
                set block at block under block under block under {eventblock.%location%} to fence
                if block under block under block under block under {eventblock.%location%} is air:
                    wait 0.5 second
                    set block at block under block under block under block under {eventblock.%location%} to fence
                    if block under block under block under block under block under {eventblock.%location%} is air:
                        wait 0.5 second
                        set block at block under block under block under block under block under {eventblock.%location%} to fence
                        if block under block under block under block under block under block under {eventblock.%location%} is air:
                            wait 0.5 second
                            set block at block under block under block under block under block under block under {eventblock.%location%} to fence
                            if block under block under block under block under block under block under block under {eventblock.%location%} is air:
                                wait 0.5 second
                                set block at block under block under block under block under block under block under block under {eventblock.%location%} to fence
                                if block under block under block under block under block under block under block under block under {eventblock.%location%} is air:
                                    wait 0.5 second
                                    set block at block under block under block under block under block under block under block under block under {eventblock.%location%} to fence
                                    stop
    else if block under block under block under block under block under block under block under block under {eventblock.%location%} is fence:
        wait 0.5 second
        set block at block under block under block under block under block under block under block under block under {eventblock.%location%} to air
        if block under block under block under block under block under block under block under {eventblock.%location%} is fence:
            wait 0.5 second
            set block at block under block under block under block under block under block under block under {eventblock.%location%} to air
            if block under block under block under block under block under block under {eventblock.%location%} is fence:
                wait 0.5 second
                set block at block under block under block under block under block under block under {eventblock.%location%} to air
                if block under block under block under block under block under {eventblock.%location%} is fence:
                    wait 0.5 second
                    set block under block under block under block under block under {eventblock.%location%} to air
                    if block under block under block under block under {eventblock.%location%} is fence:
                        wait 0.5 second
                        set block under block under block under block under {eventblock.%location%} to air
                        if block under block under block under {eventblock.%location%} is fence:
                            wait 0.5 second
                            set block under block under block under {eventblock.%location%} to air
                            if block under block under {eventblock.%location%} is fence:
                                wait 0.5 second
                                set block at block under block under {eventblock.%location%} to air
                                if block under {eventblock.%location%} is fence:
                                    wait 0.5 second
                                    set block at block under {eventblock.%location%} to air
 
Do you still need help with this?
[doublepost=1589408901,1589400816][/doublepost]If you still need help with your skript I would recommend looking into loops, I can also write a skript to give an example if you would like.