Solved How regenerate the floor

  • 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.
Feb 24, 2017
191
7
0
23
foroendertheth.foroactivo.com
This is the code I whant to regenerate the floor wend the tnt blow. I try loop all bloks in radius 50 of the player add loop-block to {block} wait 3 second add {block} to loop-block but that does not work

code_language.skript:
options:
    logo: &9&l<&b&lAr&a&lmas&9&l>&e&l

command /armas [<text>]:
    trigger:
        if arg 1 is "bazooka":
            give a stone sword named "&aBazooka" to the player
on rightclick:
    held item of the player is stone sword named "&aBazooka":
        if {bazooka.delay.%player%} is true:
            send "{@logo}Espera 3 segundos"
        else:
            set {bazooka.delay.%player%} to true
            make the player shoot a tnt at speed 2
            wait 3 second
            delete {bazooka.delay.%player%}
 
code_language.skript:
options:
    logo: &9&l<&b&lAr&a&lmas&9&l>&e&l

command /armas [<text>]:
    trigger:
        if arg 1 is "bazooka":
            give a stone sword named "&aBazooka" to the player

on rightclick:
    held item of the player is stone sword named "&aBazooka":
        if {bazooka.delay.%player%} is true:
            send "{@logo} Espera 3 segundos"
        else:
            set {bazooka.delay.%player%} to true
            # need to use "spawn" to edit the metadata
            spawn primed tnt at player
            push last spawned entity in direction of player at speed 2
            set metadata value "Bazooka" of last spawned entity to "%player%"
            wait 3 second
            delete {bazooka.delay.%player%}

# on explosion
on explode:
    # all entities around 0.5 blocks of location
    loop entities in radius 0.5 of event-location:
        # if loop-entity is our tnt shell
        metadata value "Bazooka" of loop-entity is set
        # save data from exploded blocks
        loop exploded blocks:
            add "%id of loop-block%" to {_blockID::*}
            add "%data value of loop-block%" to {_blockData::*}
            add location of loop-block to {_blockLoc::*}
        # wait some time
        wait 40 ticks
        # reset blocks
        loop {_blockLoc::*}:
            set {_block} to "%{_blockID::%loop-index%}%:%{_blockData::%loop-index%}%" parsed as item
            set block at loop-value-2 to {_block}

You'll need Skellett to use the metadata stuff
 
thanks and how I do a protection stones this is the code I have for now but is not working set something of loop-block is use too many times

code_language.skript:
options:
    logo: &9&l<&b&lPS&9&l>
    
on place of a sponges: #stone silverfishes or cobble silverfishes
    loop all blocks in radius 10 of the player:
        if {protec::*} is player:
            loop all blocks in radius 10 of the player:
                add loop-block-1 to {protec::%player%}
                send "{@logo}zona 10x10 protegida"
                exit loop
        else if {protec::*} is not player:
            send "{@logo}Esta zona ya esta protegida"
            cancel event
        else:
            loop all blocks in radius 10 of the player:
                add loop-block-2 to {protec::%player%}
                send "{@logo}zona 10x10 protegida"           
                exit loop
 
Status
Not open for further replies.