1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Replacing former blocks after an explode event

Discussion in 'Requests' started by Cengiz Elginoz, Jun 2, 2017.

  1. Cengiz Elginoz

    Cengiz Elginoz New Member

    Joined:
    May 4, 2017
    Messages:
    8
    Likes Received:
    0
    It's done. Thank you.
     
    #1 Cengiz Elginoz, Jun 2, 2017
    Last edited: Jun 8, 2017
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Is it work with your coding ? Do you have errors with this skript ?
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    set loop-block to event-block
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    [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 (Skript):
    1. on explode:
    2.     wait 10 seconds
    3.     loop exploded blocks:
    4.         wait 0.5 ticks
    5.         set loop-block to event-block
    6.     stop
    It says.
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    try
    Code (Skript):
    1. set loop-block to exploded block
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    [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 (Skript):
    1. on explode:
    2.     loop exploded blocks:
    3.         wait 0.5 ticks
    4.         set loop-block to exploded block
    5.     stop
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. on explode:
    2.     loop exploded blocks:
    3.         set {_boom::%location of loop-block%} to type of loop-block
    4.     wait 10 seconds
    5.     loop {_boom::*}:
    6.         set block at loop-index to loop-value
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    [00:52:42 ERROR]: loop-index is not a location (digerozellikler.sk, line 29: set
    block at loop-index to loop-value')
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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 (Text):
    1.  
    2. on skript load:
    3.     clear {limpando}
    4.  
    5. on place:
    6.     if {limpando} is set:
    7.         cancel event
    8.         stop
    9.     if {colocado::%location of event-block%} is not set:
    10.         add block at event-location to {blocosremover::*}
    11.         set {loopr::%block at event-location%} to type of block at event-location
    12.         set {colocado::%location of event-block%} to "%player%"
    13.        
    14. on break:
    15.     if {limpando} is set:
    16.         cancel event
    17.         stop
    18.     if event-block is not air:
    19.         {colocado::%location of event-block%} is not set
    20.         add block at event-location to {blocks::*}
    21.         set {loop::%block at event-location%} to type of block at event-location
    22.     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:
    23.         add location of block above event-block to {blocks::*}
    24.         set {loop::%location of block above event-block%} to type of block above event-block
    25.         set block above event-block to air
    26.        
    27. command /regenmapa:
    28.     executable by: console
    29.     trigger:
    30.         if {limpando} is set:
    31.             send "&9[ARG] &eO mapa já está sendo regenerado!"
    32.             stop
    33.         broadcast "&9[ARG] &eO mapa está sendo regenerado!"
    34.         set {limpando} to true
    35.         loop {blocks::*}:
    36.             set block at loop-value to {loop::%loop-value%}
    37.             play note sticks at loop-value with pitch 1
    38.             wait 1 tick
    39.         clear {blocks::*}
    40.         loop {blocosremover::*}:
    41.             if type of block at loop-value is {loopr::%loop-value%}:
    42.                 set block at loop-value to air
    43.                 wait 1 tick
    44.         clear {colocado::*}
    45.         clear {loop::*}
    46.         broadcast "&9[ARG] &eArrumação do mapa completada!"
    47.         clear {limpando}
    48.        
    49. command /regenmapa2:
    50.     trigger:
    51.         clear {limpando}
    52.        
    53. on explode:
    54.     if {limpando} is set:
    55.         cancel event
    56.         stop
    57.     loop exploded blocks:  
    58.         if loop-block is not air:
    59.             {colocado::%location of loop-block%} is not set
    60.             add location of loop-block to {blocks::*}
    61.             set {loop::%location of loop-block%} to type of block at location of loop-block
    62.         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:
    63.             add location of block above loop-block to {blocks::*}
    64.             set {loop::%location of block above loop-block%} to type of block above loop-block
    65.             set block above loop-block to air
    66.            
    67. on block physics:
    68.     event-block is grass
    69.     cancel event
    70.  

    I hope it becomes useful to you and good luck.
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    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
    maybe this?
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    It didn't work :/

    [ERROR]: text cannot be parsed as a location (digerozellikler.sk, line 29: set
    block at ("%loop-index%" parsed as location)')
    --- Double Post Merged, Jun 4, 2017, Original Post Date: Jun 4, 2017 ---

    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:
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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 (Skript):
    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 location ("%loop-index%" parsed as location) to loop-value
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Didn't work :/
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. on explode:
    2.   loop exploded blocks:
    3.     set {_e::%location of loop-value%} to true
    4.     set {_e::%location of loop-value%::*} to location of loop-value and type of loop-value
    5.   wait 10 second
    6.   loop {_e::*}:
    7.     set block at {_e::%loop-index%::1} to {_e::%loop-index%::2}
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    It worked! Thank you so much! I'll mark solved.
     
    #16 ShaneBee, Jun 5, 2017
    Last edited by a moderator: Jun 5, 2017

Share This Page

Loading...