1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved cancel event only for specific blocks with on explode trigger

Discussion in 'Skript' started by ilovepancake, Sep 1, 2019.

Thread Status:
Not open for further replies.
  1. ilovepancake

    ilovepancake Member

    Joined:
    Sep 1, 2019
    Messages:
    2
    Likes Received:
    0
    Hi, I wanted to cancel event on explosion only for grass but cancel event cancel for every blocks.
    I tried to remove the block from exploded blocks but that not working without error:

    Code (Text):
    1.  
    2. on explode:
    3.   loop exploded blocks:
    4.     if loop-block is equal to grass block:
    5.       remove loop-block from exploded blocks
    6.  
    It should be possible because the tntwars in cubed craft, when a cannon explode, only the dispensers are exploded
     
  2. Best Answer:
    Post #2 by Vorze, Oct 2, 2019
  3. Vorze

    Vorze Active Member

    Joined:
    Jul 10, 2017
    Messages:
    69
    Likes Received:
    2
    Try This:
    Code (Text):
    1. on explosion:
    2.     cancel event
    3.     create a safe explosion of force 2 at event-location
    4.     loop exploded blocks:
    5.         if loop-block is not grass or tnt:
    6.             set loop-block to air
    7.         if loop-block is tnt:
    8.             set loop-block to air
    9.             spawn a primed tnt at the loop-block's location
    10.             push last spawned entity direction from event-location to last spawned entity with force 1
    11.  
     
    #2 Vorze, Oct 2, 2019
    Last edited: Oct 3, 2019
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...