Solved TNT explode blocks from list

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

Hobbit41

Member
Jun 15, 2017
32
0
0
30
Minecraft version: 1.8

Hi guys. I have a list where all placed blocks (coordinates of them) by players are stored. When somebody is trying to remove any block not from that list, event is canceled - it works fine.

But now Im trying to create tnt, which when exploded will break ONLY blocks from that list. And I am completely out of ideas. Do you have any?

P.S.: my list named {placedblocks::*}
 
code:
on explode:
----wait 1 tick
----loop exploded blocks:
--------loop {placedblocks::*}:
------------if location of loop-block is loop-value-2:
----------------set block at location of loop-block to air
----------------drop a loop-block at location of loop-block
------------else:
----------------set block at location of loop-block to loop-block
 
code:
on explode:
----wait 1 tick
----loop exploded blocks:
--------loop {placedblocks::*}:
------------if location of loop-block is loop-value-2:
----------------set block at location of loop-block to air
----------------drop a loop-block at location of loop-block
------------else:
----------------set block at location of loop-block to loop-block
no, that's not working.
Every block is being destroyed, placed by players or not.
[doublepost=1503762647,1503159230][/doublepost]bump, still need help
[doublepost=1503784078][/doublepost]Dont know why, but this line of code works fine even if It has 2 "cancel event" in both IF's
code_language.skript:
on explode:
    {placedblocks::*} is not set:
        cancel event
    else:
        loop exploded blocks:
            loop {placedblocks::*}:
                location of loop-block is equal to loop-value-2:
                    cancel event
                else:
                    cancel event

but if to remove "else" it would break any blocks if in radius are no any placed-by-players block's.
 
Status
Not open for further replies.