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.

How to make tnt only explode blocks from a list

Discussion in 'Skript' started by WilliamPlays0402, Aug 23, 2020.

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

    Joined:
    Jun 11, 2020
    Messages:
    14
    Likes Received:
    0
    Hello,
    I am trying to make a simple bedwars script, but I would like to only be able to explode blocks from a list called "{blockplaced::*}". Everything except the tnt is working. This is what I have coded so far, but the tnt explodes ALL blocks:
    Code (Text):
    1. on explode:
    2.   loop exploded blocks:
    3.     if loop-value-1 is any bed:
    4.       cancel the event
    5.       set block at loop-block to loop-block
    6.       uncancel the event
    7.     else:
    8.       loop {blockplaced::*}:
    9.         if location of loop-value-1 is loop-value-2:
    10.           continue
    11.         else:
    12.           cancel the event
    13.           set block at loop-block-1 to loop-block-1
    14.           uncancel the event
    If you know how this is wrong, please comment below ☺


    Information:
    Skript version: 2.5-beta2
    Server version: git-Paper-133 (MC: 1.16.1)
    Skript addons: <none> (yet) (EDIT 1: Added SkRayFall)
     
    #1 WilliamPlays0402, Aug 23, 2020
    Last edited: Aug 24, 2020
  2. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    429
    Likes Received:
    30
    Maybe not a particularly efficient implementation but it's what I could come up with quickly
    Code (Text):
    1. on explode:
    2.     cancel event
    3.     loop exploded blocks where [{blockplaced::*} contains input]:
    4.         break block at loop-value's location
     
  3. WilliamPlays0402

    Joined:
    Jun 11, 2020
    Messages:
    14
    Likes Received:
    0
    It did not work. Nothing broke.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...