Solved Beancan Grenade

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

CringeBoy

Active Member
May 20, 2021
65
0
6
Romania
Code:
on projectile hit:
  event-projectile is egg
  wait 150 tick
  create an explosion of force 1
This is my currently code of "Beancan Grenade" which is supposed to raid with. Can someone help me with making a block's durability of egg's explosion? Like you can break a plank with 13 beancans, or a cobblestone block with 46.
 
The only way of solving I can think of is looping the blocks in the area and add them a custom durability value.
Code:
loop blocks in radius 2 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is glass:
        if  {explosiondurability::%loop-block%} is more than or equal to 1:
            break loop-block naturally
    if loop-block is cobblestone:
        if  {explosiondurability::%loop-block%} is more than or equal to 46:
            break loop-block naturally
 
Code:
[WARNING] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (beancan.sk, line 8: if {explosiondurability::%loop-block%} is more than or equal to 46:')

[WARNING] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (beancan.sk, line 11: if {explosiondurability::%loop-block%} is more than or equal to 13:')
I am getting those things. And the durability on stone works, but on oak wooden plank it breaks it instantly.
 
Code:
on projectile hit:
  event-projectile is egg
  wait 150 tick
  create an explosion of force 1
loop blocks in radius 2 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is oak wooden plank:
        if  {explosiondurability::%loop-block%} is more than or equal to 3:
            break loop-block naturally
    if loop-block is cobblestone:
        if  {explosiondurability::%loop-block%} is more than or equal to 46:
            break loop-block naturally
 
Code:
on projectile hit:
  event-projectile is egg
  wait 150 tick
  create an explosion of force 1
  loop blocks in radius 2 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is oak wooden plank:
      if {explosiondurability::%loop-block%} is more than or equal to 3:
        break loop-block naturally
    if loop-block is cobblestone:
      if {explosiondurability::%loop-block%} is more than or equal to 46:
        break loop-block naturally
 
Code:
on projectile hit:
  event-projectile is egg
  wait 150 tick
  create an explosion of force 1
  loop blocks in radius 2 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is oak wooden plank:
      if {explosiondurability::%loop-block%} is more than or equal to 3:
        break loop-block naturally
    if loop-block is cobblestone:
      if {explosiondurability::%loop-block%} is more than or equal to 46:
        break loop-block naturally
Code:
[WARNING] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (beancan.sk, line 11: if {explosiondurability::%loop-block%} is more than or equal to 46:')
I am getting this now
[doublepost=1621777362,1621777243][/doublepost]And it also breaks oak wooden plank / cobblestone instantly instead of 13 beancans for oak wooden plank and 46 for cobblestone
 
Ok. There are no errors. But it still breaks the oak wooden plank from just 1 beancan, and the cobblestone from about 30, not with 46 as it says in the script
 
then you already threw some at them
No. I built like 4 platforms, also not connected and tested beancan on oak wooden plank / cobblestone
[doublepost=1621778621,1621778254][/doublepost]Same problem on satchel. The difference is that it breaks from just 1 satchel both of them, oak wooden plank, cobblestone
[doublepost=1621778675][/doublepost]
Code:
on place of oak wood button:
  play sound "expl.satchel" with volume 1 and pitch 1 to player
  wait 150 tick
  create an explosion of force 1
  play sound "expl.boom" with volume 1 and pitch 1 to player
loop blocks in radius 2 around event-location:
    add 1 to {explosiondurability::%loop-block%}
    if loop-block is oak wooden plank:
        if  {explosiondurability::%loop-block%} is more than or equal to 3:
            break loop-block naturally
    if loop-block is cobblestone:
        if  {explosiondurability::%loop-block%} is more than or equal to 10:
            break loop-block naturally
is there any fix for satchel that it doesn't break from 3 satchels oak wooden plank and cobblestone with 10 ?
[doublepost=1621779769][/doublepost]Someone helped me to fix it, thank you so much for your help!
 
Status
Not open for further replies.