Explosions on specific player blocks

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

BryHunter

Member
Jan 10, 2018
35
2
8
27
Code:
on block place:

    If lore of player's tool is "&r  ||&8&l> &7Player Block":

        set {blockplace::%event-location%} to player

        set action bar of player to "&4[PlayerBlocks] &7Block placed successfully"



Alrighty so i am trying to make it so when players place a block that block is then registered to them, this is working properly. Then i tried to make it so these specific registered blocks take more than 1 tnt to explode. This i got working with the example below:



Code:
on explosion:

    loop exploded blocks:

        if loop-block is glass:

            if {explosion::%loop-block%} is not set:

                cancel event

                set {explosion::%loop-block%} to 1

            else:

                if {explosion::%loop-block%} < 10:

                    cancel event

                    add 1 to {explosion::%loop-block%}

                else:

                    clear {explosion::%loop-block%}

                    delete {blockplace::%location of loop-block%}

But when i tried to add it in so its only the registered blocks take more than 1 tnt to explode it did not work... which is the example below:



Code:
on explosion:

    loop exploded blocks:

        if loop-block is glass:

            if {blockplace::%event-location%} is set:

                if {explosion::%loop-block%} is not set:

                    cancel event

                    set {explosion::%loop-block%} to 1

                else:

                    if {explosion::%loop-block%} < 10:

                        cancel event

                        add 1 to {explosion::%loop-block%}

                    else:

                        clear {explosion::%loop-block%}

                        delete {blockplace::%location of loop-block%}
 
  • Like
Reactions: LukynkaCZE
Hi, I've been thinking about this for about 30 minutes. This should work.

Code:
on block place:
 
    If lore of player's tool is "&r  ||&8&l> &7Player Block":
 
        set {blockplace::%event-location%} to player
 
        set action bar of player to "&4[PlayerBlocks] &7Block placed successfully"


on explosion:
 
    loop exploded blocks:
 
        if loop-block is glass:
            set {loc.%loop-block%} to location of loop-block
            if {blockplace::%{loc.%loop-block%}%} is set:
 
                if {explosion::%loop-block%} is not set:
 
                    cancel event
 
                    set {explosion::%loop-block%} to 1
 
                else:
 
                    if {explosion::%loop-block%} < 10:
    
                        cancel event
    
                        add 1 to {explosion::%loop-block%}
    
                    else:
    
                        clear {explosion::%loop-block%}
    
                        delete {blockplace::%location of loop-block%}

Tested and its working for me :emoji_slight_smile:
 
Status
Not open for further replies.