Solved Block has problems

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

Dxn

New Member
Nov 8, 2021
8
0
1
18
Code:
on projectile hit:
  projectile is an snowball:
    play sound "expl.bazooka" with volume 100 with pitch 1 at shooter for shooter
  create an explosion of force 1
  loop blocks in radius 6 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is oak wooden plank:
      {explosiondurability::%loop-block%} is more than or equal to 4
      set loop-block to air
    if loop-block is cobblestone:
      {explosiondurability::%loop-block%} is more than or equal to 5
      set loop-block to air
    if loop-block is spruce wooden plank:
      {explosiondurability::%loop-block%} is more than or equal to 6
      set loop-block to air
    if loop-block is obsidian:
      {explosiondurability::%loop-block%} is more than or equal to 7
      set loop-block to air
I have a problem. If you build as example some cobblestone somewhere and the blocks get destroyed by the snowball, if you place the blocks again they will instantly blow instead of getting destroyed by using the snowball 5 times. Like "{explosiondurability::%loop-block%} is more than or equal to 5" you gotta use the snowball 5 times to destroy the blocks, but they get destroyed instantly. Please someone help me!
 
I believe you have to delete this value=variable when the blocks are removed.
Code:
set loop-block to air
clear {explosiondurability::%loop-block%}

Also, it should be probably cleared when you remove it by yourself too:
Code:
on break:
  {explosiondurability::%event-block%} is set
  clear {explosiondurability::%event-block%}
 
Status
Not open for further replies.