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 Exact ID of Block (eg. 17:12)

Discussion in 'Skript' started by Lukhausen, Apr 5, 2017.

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

    Lukhausen Active Member

    Joined:
    Mar 20, 2017
    Messages:
    145
    Likes Received:
    11
    Hey.

    I’m working on a Skript which is able to replace blocks that were destroyed after 3 seconds.
    now there is a problem:

    if I destroy for example destroy a stair that’s facing upside down, the stair gets seted to a normal facing stair after 3 seconds.
    But I want skript to set the block to exactly the same one as which it was before.

    [​IMG] [​IMG]

    Here is the code:
    Code (Skript):
    1. on break:
    2.     cancel event
    3.     delete the block
    4.     set {_block.loc.%player%} to location of block
    5.     set {_block.id.%player%} to ("%block%" parsed as item)
    6.     wait 3 seconds
    7.     set block at location of {_block.loc.%player%} to {_block.id.%player%}


     
  2. Best Answer:
    Post #5 by ShaneBee, Apr 5, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    226
    1. You don't have to use the player in your variable name if it's a local variable (they are deleted after the event is triggered)
    2. Why are you parsing the block as an item stack? That's useless.
    3. The {_block.loc.%player%} is already a location, you don't have to put "location of", Skript already knows.
    4. Why not just use the location event value? (event-location).

    Your issue might be the 2nd thing that I said.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    226
    That doens't work at all:

    Code (Skript):
    1. on build:
    2.     cancel event
    3.     delete the block
    4.     set {_block.loc} to event-location
    5.     set {_block.id} to block
    6.     wait 3 seconds
    7.     set block {_block.loc} to {_block.id}
    That works but has the block problem again...

    Code (Skript):
    1. on build:
    2.     cancel event
    3.     delete the block
    4.     set {_block.loc} to event-location
    5.     set {_block.id} to ("%block%" parsed as item)
    6.     wait 3 seconds
    7.     set block {_block.loc} to {_block.id}
    What should I parse the block to? Just using:
    Code (Skript):
    1. set {_block.id} to block
    won't work
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    226
    Why are u setting local variables for that?
    Code (Skript):
    1. on build:
    2.     cancel the event
    3.     wait 3 seconds
    4.     set block at event-location to event-block
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    226
    ok solved now :emoji_slight_smile:


    Code (Skript):
    1. on build:
    2.     cancel event
    3.     delete the block
    4.     set {_block.loc} to event-location
    5.     set {_block.id} to id of block
    6.     set {_block.data} to data of block
    7.     set {_block.block} to ("%{_block.id}%:%{_block.data}%" parsed as item)
    8.     wait 3 seconds
    9.     set block {_block.loc} to {_block.block}
    10. on block physics:
    11.     cancel event
    --- Double Post Merged, Apr 5, 2017, Original Post Date: Apr 5, 2017 ---
    becasue that don't woks :emoji_slight_smile: i dont know why but it don't work...
     
Thread Status:
Not open for further replies.

Share This Page

Loading...