Despawn Falling blocks when they hit the ground

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

Melody

Member
Jan 19, 2021
17
1
3
23
I was trying to make a fake explosion script which throws some falling blocks around to make it better but is there anyway I can despawn the falling blocks?
 
You can use the falling block land event to know when the blocks land, and you can then delete the blocks when they do.
Code:
on falling block land:
    set event-block to air
# note this deletes ALL falling blocks, not just the ones from the explosion
 
You can use the falling block land event to know when the blocks land, and you can then delete the blocks when they do.
Code:
on falling block land:
    set event-block to air
# note this deletes ALL falling blocks, not just the ones from the explosion
Mmm works but another thing is I tried to replace the loop-blocks around the player but it seems to make ghost blocks any solutions?
 
Can I see the code you're using?
Actually I just realized it does not work at all! when I spawn the falling blocks It just turns them into bedrock

on right click:
if player's tool is tnt:
if uncolored name of the tool of player is "Explosive":
if {totalmana.%player%} >= 100:
if {cooldown.hyperion.%player%} is false:
set {cooldown.hyperion.%player%} to true
send "&aItem Ability &6Explosive &b-100 Mana"
remove 100 from {totalmana.%player%}
set {_damage} to 2 * (1 + ({manapoolcap.%player%} / 100) * 0.2)
loop blocks in radius 5 around player:
spawn falling block of loop-block at loop-block
set loop-block to bedrock
push last spawned falling block up with force 1
push last spawned falling block forwards with force 5

chance of 40%:
create a fake explosion at {_block}

loop all entities in radius 5 around the player:
if loop-entity isn't a player:
damage loop-entity by {_damage}
wait 5 ticks
set {cooldown.hyperion.%player%} to false
else:
send "&cYou dont have enough mana to use this ability"
[doublepost=1615296393,1615216044][/doublepost]boop?
[doublepost=1615382782][/doublepost]Someone help please!
 
Actually I just realized it does not work at all! when I spawn the falling blocks It just turns them into bedrock

on right click:
if player's tool is tnt:
if uncolored name of the tool of player is "Explosive":
if {totalmana.%player%} >= 100:
if {cooldown.hyperion.%player%} is false:
set {cooldown.hyperion.%player%} to true
send "&aItem Ability &6Explosive &b-100 Mana"
remove 100 from {totalmana.%player%}
set {_damage} to 2 * (1 + ({manapoolcap.%player%} / 100) * 0.2)
loop blocks in radius 5 around player:
spawn falling block of loop-block at loop-block
set loop-block to bedrock
push last spawned falling block up with force 1
push last spawned falling block forwards with force 5

chance of 40%:
create a fake explosion at {_block}

loop all entities in radius 5 around the player:
if loop-entity isn't a player:
damage loop-entity by {_damage}
wait 5 ticks
set {cooldown.hyperion.%player%} to false
else:
send "&cYou dont have enough mana to use this ability"
[doublepost=1615296393,1615216044][/doublepost]boop?
[doublepost=1615382782][/doublepost]Someone help please!
Please, read your code:


upload_2021-3-10_15-56-10.png
 
Status
Not open for further replies.