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 A variable can carry a block ?

Discussion in 'Skript' started by Skoll, Sep 30, 2020.

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

    Skoll Active Member

    Joined:
    Sep 2, 2020
    Messages:
    65
    Likes Received:
    6
    E.g. save an event-block into a list variable {block::*}. It's possible ? Because I'm not getting.

    Code (Text):
    1. on place:
    2.   add event-block to {blocks::*}
    3.  
    4. on break:
    5.     loop all blocks in {blocks::*}:
    6.         broadcast "%loop-block%"
    Doesn't broadcast.

    Works if I change to:
    Code (Text):
    1. on break:
    2.   loop {blocks::*} :
    3.     broadcast "%loop-value%"
    But I cannot check if loop-value is event-block.
    E.g.:
    Code (Text):
    1. on break:
    2.   loop {blocks::*}:
    3.     if event-block is loop-value:
    4.       broadcast "it is"
    Doesn't broadcast. Why ?
     
  2. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    203
    Likes Received:
    4
    Code (Text):
    1. on break:
    2.     if {blocks::*} contains event-block:
    3.         broadcast "it is"
     
  3. Skoll

    Skoll Active Member

    Joined:
    Sep 2, 2020
    Messages:
    65
    Likes Received:
    6
    I don't remember what problem i had with this code, but doesnt work too.

    I already solved this problem comparing locations and using the location to return what block is placed. Thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...