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

Setting block

Discussion in 'Skript' started by deminecrafterlol, Mar 13, 2018.

Tags:
Thread Status:
Not open for further replies.
  1. deminecrafterlol

    Joined:
    May 17, 2017
    Messages:
    6
    Likes Received:
    0
    How do i set a block from a location variable

    Like:
    Code (Skript):
    1. set location of block to {Block}
    2. set {Block} to tripwire
     
  2. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,234
    Likes Received:
    172
    Medals:
    1. That's not how you set a variable to a location, you have to set the variable to the location not the other way around.
    2. Just use the block expression to get the block at a specific direction and location.
     
  3. deminecrafterlol

    Joined:
    May 17, 2017
    Messages:
    6
    Likes Received:
    0
    well, i do this:
    Code (Skript):
    1. on rightclick:
    2.     if clicked block is tripwire:
    3.         set clicked block to oak plank
    4.         add location of clicked block to {Seige.blocks.relative::*}
    And when some thing is done, i do this:
    Code (Skript):
    1. set {_index} to 0
    2.         loop {Seige.blocks.relative::*}:
    3.             add 1 to {_index}
    4.             set block {Seige.blocks.relative::%{_index}%} to tripwire
    is that good?
     
    #3 deminecrafterlol, Mar 13, 2018
    Last edited: Mar 13, 2018
  4. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,311
    Likes Received:
    73
    Medals:
    Code (Skript):
    1. set block at {Seige.blocks.relative::%{_index}%} to tripwire
    or
    Code (Skript):
    1. set block at loop-value to tripwire
     
    • Like Like x 1
Thread Status:
Not open for further replies.
Loading...