How to make zombie barricate?

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

    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.

FishRekt

Active Member
Jan 26, 2017
87
0
0
I want to make a zombie barricate system like hypixel:

code_language.skript:
every 1 second:
    loop all players:
        if block under the loop-player is sponge:
            if loop-player is sneaking:
                if {locazione1} > 0:
                    if {locazione1} is 6:
                        set block at {loc.1} to stone
                        remove 1 from {locazione1}
                    if {locazione1} is 5:
                        set block at {loc.2} to stone
                        remove 1 from {locazione1}
                    if {locazione1} is 4:
                        set block at {loc.3} to stone
                        remove 1 from {locazione1}
                    if {locazione1} is 3:
                        set block at {loc.4} to stone
                        remove 1 from {locazione1}
                    if {locazione1} is 2:
                        set block at {loc.5} to stone
                        remove 1 from {locazione1}
                    if {locazione1} is 1:
                        set block at {loc.6} to stone
                        remove 1 from {locazione1}
                    send "&9Zombie>&7 Barricando la locazione &e(%{locazione1}%/6)" to loop-player
                   
every 1 second:
    loop all zombies:
        if block under the loop-zombie is stone:
            if {locazione1} < 6:
                add 1 to {locazione1}
                if {locazione1} is 6:
                    set block at {loc.1} to air
                if {locazione1} is 5:
                    set block at {loc.2} to air
                if {locazione1} is 4:
                    set block at {loc.3} to air
                if {locazione1} is 3:
                    set block at {loc.4} to air
                if {locazione1} is 2:
                    set block at {loc.5} to air
                if {locazione1} is 1:
                    set block at {loc.6} to air
                       
command /addlocation [<text>]:
    trigger:
        set {loc.%arg-1%} to location of player
command /locazione1:
    trigger:
        set {locazione1} to 6
        send "d" to player

This is not working.. It doesn't set blocks and it says "0/6" all the times.. What am i doing wrong?
 
Because the variable is probably always 0, making
code_language.skript:
if {locazione1} > 0:
impossible to pass.
 
Well idk what to tell you bud. Are the zombies even adding the variable?
 
That's not the problem. The problem is when the player is adding the fences
 
Then yes, you basically answered my question. The variable isn't working. Keep debugging.
 
Debugging is used for several things.
1. To check if the condition passes. Under the condition, add a broadcast to signal the player that the condition works.
2. To check the variable's value. Example would be broadcast "%{test::var}%". It checks what the value is held by the variable.
3. To check if the command arguments work. Also check if the command triggers or successfully works. Example would be broadcast "%arg-1% %arg-2% %arg-3%" or something like that.
4. To check for any values used with % % in a text. Example would be broadcast "%player's held item%".
 
I found the problem. The problem is this:

code_language.skript:
every 1 second:
    loop all zombies:
        if block under the loop-zombie is stone:
            if {zombies} < 6:
                if {zombies} is 5:
                    set block at {loc.1} to air
                if {zombies} is 4:
                    set block at {loc.2} to air
                if {zombies} is 3:
                    set block at {loc.3} to air
                if {zombies} is 2:
                    set block at {loc.4} to air
                if {zombies} is 1:
                    set block at {loc.5} to air
                if {zombies} is 0:
                    set block at {loc.6} to air
                add 1 to {zombies}
[doublepost=1503274484,1503190636][/doublepost]bump
 
Status
Not open for further replies.