Solved Replacing former blocks after an explode event

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

No i dont have any. I just want the former blocks to be replaced after an explode event. This codes replace grass block but i want former blocks instead.
 
set loop-block to event-block
[15:40:08 ERROR]: There's no block in an on explode event (digerozellikler.sk, l
ine 102: set loop-block to event-block')

code_language.skript:
on explode:
    wait 10 seconds
    loop exploded blocks:
        wait 0.5 ticks
        set loop-block to event-block
    stop

It says.
 
try
code_language.skript:
set loop-block to exploded block
[14:53:44 ERROR]: a block can't be set to 'exploded block' because the latter is
not an item type (digerozellikler.sk, line 35: set loop-block to exploded block
')

code_language.skript:
on explode:
    loop exploded blocks:
        wait 0.5 ticks
        set loop-block to exploded block
    stop
 
code_language.skript:
on explode:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at loop-index to loop-value
 
code_language.skript:
on explode:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at loop-index to loop-value

[00:52:42 ERROR]: loop-index is not a location (digerozellikler.sk, line 29: set
block at loop-index to loop-value')
 
I've found this script in my very old scripts folder. It may be useful, or not.
It basically saves the blocks you place and then regenerates at once or every x time. I did not edit it and I'm too lazy for that.

Code:
on skript load:
    clear {limpando}

on place:
    if {limpando} is set:
        cancel event
        stop
    if {colocado::%location of event-block%} is not set:
        add block at event-location to {blocosremover::*}
        set {loopr::%block at event-location%} to type of block at event-location
        set {colocado::%location of event-block%} to "%player%"
       
on break:
    if {limpando} is set:
        cancel event
        stop
    if event-block is not air:
        {colocado::%location of event-block%} is not set
        add block at event-location to {blocks::*}
        set {loop::%block at event-location%} to type of block at event-location
    if block above event-block is flower or potato plant or carrot plant or tall grass or melon or pumpkin or melon stem or pumpkin stem or gravel or sand or wheat:
        add location of block above event-block to {blocks::*}
        set {loop::%location of block above event-block%} to type of block above event-block
        set block above event-block to air
       
command /regenmapa:
    executable by: console
    trigger:
        if {limpando} is set:
            send "&9[ARG] &eO mapa já está sendo regenerado!"
            stop
        broadcast "&9[ARG] &eO mapa está sendo regenerado!"
        set {limpando} to true
        loop {blocks::*}:
            set block at loop-value to {loop::%loop-value%}
            play note sticks at loop-value with pitch 1
            wait 1 tick
        clear {blocks::*}
        loop {blocosremover::*}:
            if type of block at loop-value is {loopr::%loop-value%}:
                set block at loop-value to air
                wait 1 tick
        clear {colocado::*}
        clear {loop::*}
        broadcast "&9[ARG] &eArrumação do mapa completada!"
        clear {limpando}
       
command /regenmapa2:
    trigger:
        clear {limpando}
       
on explode:
    if {limpando} is set:
        cancel event
        stop
    loop exploded blocks:   
        if loop-block is not air:
            {colocado::%location of loop-block%} is not set
            add location of loop-block to {blocks::*}
            set {loop::%location of loop-block%} to type of block at location of loop-block
        if block above loop-block is flower or potato plant or carrot plant or tall grass or melon or pumpkin or melon stem or pumpkin stem or gravel or sand or wheat:
            add location of block above loop-block to {blocks::*}
            set {loop::%location of block above loop-block%} to type of block above loop-block
            set block above loop-block to air
           
on block physics:
    event-block is grass
    cancel event

I hope it becomes useful to you and good luck.
 
[00:52:42 ERROR]: loop-index is not a location (digerozellikler.sk, line 29: set
block at loop-index to loop-value')
code_language.skript:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at ("%loop-index%" parsed as location) to loop-value

maybe this?
 
code_language.skript:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at ("%loop-index%" parsed as location) to loop-value

maybe this?

It didn't work :/

[ERROR]: text cannot be parsed as a location (digerozellikler.sk, line 29: set
block at ("%loop-index%" parsed as location)')
[doublepost=1496537268,1496537117][/doublepost]
I've found this script in my very old scripts folder. It may be useful, or not.
It basically saves the blocks you place and then regenerates at once or every x time. I did not edit it and I'm too lazy for that.

Code:
on skript load:
    clear {limpando}

on place:
    if {limpando} is set:
        cancel event
        stop
    if {colocado::%location of event-block%} is not set:
        add block at event-location to {blocosremover::*}
        set {loopr::%block at event-location%} to type of block at event-location
        set {colocado::%location of event-block%} to "%player%"
     
on break:
    if {limpando} is set:
        cancel event
        stop
    if event-block is not air:
        {colocado::%location of event-block%} is not set
        add block at event-location to {blocks::*}
        set {loop::%block at event-location%} to type of block at event-location
    if block above event-block is flower or potato plant or carrot plant or tall grass or melon or pumpkin or melon stem or pumpkin stem or gravel or sand or wheat:
        add location of block above event-block to {blocks::*}
        set {loop::%location of block above event-block%} to type of block above event-block
        set block above event-block to air
     
command /regenmapa:
    executable by: console
    trigger:
        if {limpando} is set:
            send "&9[ARG] &eO mapa já está sendo regenerado!"
            stop
        broadcast "&9[ARG] &eO mapa está sendo regenerado!"
        set {limpando} to true
        loop {blocks::*}:
            set block at loop-value to {loop::%loop-value%}
            play note sticks at loop-value with pitch 1
            wait 1 tick
        clear {blocks::*}
        loop {blocosremover::*}:
            if type of block at loop-value is {loopr::%loop-value%}:
                set block at loop-value to air
                wait 1 tick
        clear {colocado::*}
        clear {loop::*}
        broadcast "&9[ARG] &eArrumação do mapa completada!"
        clear {limpando}
     
command /regenmapa2:
    trigger:
        clear {limpando}
     
on explode:
    if {limpando} is set:
        cancel event
        stop
    loop exploded blocks: 
        if loop-block is not air:
            {colocado::%location of loop-block%} is not set
            add location of loop-block to {blocks::*}
            set {loop::%location of loop-block%} to type of block at location of loop-block
        if block above loop-block is flower or potato plant or carrot plant or tall grass or melon or pumpkin or melon stem or pumpkin stem or gravel or sand or wheat:
            add location of block above loop-block to {blocks::*}
            set {loop::%location of block above loop-block%} to type of block above loop-block
            set block above loop-block to air
         
on block physics:
    event-block is grass
    cancel event

I hope it becomes useful to you and good luck.


Please could you make it a bit organised? I really need this skript :/ I'm building a faction server and this will be good. If you do, I'll be apreciated :emoji_slight_smile:
 
It didn't work :/

[ERROR]: text cannot be parsed as a location (digerozellikler.sk, line 29: set
block at ("%loop-index%" parsed as location)')
[doublepost=1496537268,1496537117][/doublepost]


Please could you make it a bit organised? I really need this skript :/ I'm building a faction server and this will be good. If you do, I'll be apreciated :emoji_slight_smile:
then last try:

  1. loop exploded blocks:
  2. set {_boom::%location of loop-block%} to type of loop-block
  3. wait 10 seconds
  4. loop {_boom::*}:
  5. set block at ("%loop-index%" parsed as location) to loop-value
code_language.skript:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at location ("%loop-index%" parsed as location) to loop-value
 
then last try:

  1. loop exploded blocks:
  2. set {_boom::%location of loop-block%} to type of loop-block
  3. wait 10 seconds
  4. loop {_boom::*}:
  5. set block at ("%loop-index%" parsed as location) to loop-value
code_language.skript:
    loop exploded blocks:
        set {_boom::%location of loop-block%} to type of loop-block
    wait 10 seconds
    loop {_boom::*}:
        set block at location ("%loop-index%" parsed as location) to loop-value

Didn't work :/
 
code_language.skript:
on explode:
  loop exploded blocks:
    set {_e::%location of loop-value%} to true
    set {_e::%location of loop-value%::*} to location of loop-value and type of loop-value
  wait 10 second
  loop {_e::*}:
    set block at {_e::%loop-index%::1} to {_e::%loop-index%::2}
 
code_language.skript:
on explode:
  loop exploded blocks:
    set {_e::%location of loop-value%} to true
    set {_e::%location of loop-value%::*} to location of loop-value and type of loop-value
  wait 10 second
  loop {_e::*}:
    set block at {_e::%loop-index%::1} to {_e::%loop-index%::2}

It worked! Thank you so much! I'll mark solved.
 
Last edited by a moderator: