Solved Exact ID of Block (eg. 17:12)

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Lukhausen

Active Member
Mar 20, 2017
145
11
18
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.

b17643006b904b9383340341971bf194.png


Here is the code:
code_language.skript:
on break:
    cancel event
    delete the block
    set {_block.loc.%player%} to location of block
    set {_block.id.%player%} to ("%block%" parsed as item)
    wait 3 seconds
    set block at location of {_block.loc.%player%} to {_block.id.%player%}
 
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.
 
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.
That doens't work at all:

code_language.skript:
on build:
    cancel event
    delete the block
    set {_block.loc} to event-location
    set {_block.id} to block
    wait 3 seconds
    set block {_block.loc} to {_block.id}

That works but has the block problem again...

code_language.skript:
on build:
    cancel event
    delete the block
    set {_block.loc} to event-location
    set {_block.id} to ("%block%" parsed as item)
    wait 3 seconds
    set block {_block.loc} to {_block.id}

What should I parse the block to? Just using:
code_language.skript:
set {_block.id} to block
won't work
 
Why are u setting local variables for that?
code_language.skript:
on build:
    cancel the event
    wait 3 seconds
    set block at event-location to event-block
 
ok solved now :emoji_slight_smile:


code_language.skript:
on build:
    cancel event
    delete the block
    set {_block.loc} to event-location
    set {_block.id} to id of block
    set {_block.data} to data of block
    set {_block.block} to ("%{_block.id}%:%{_block.data}%" parsed as item)
    wait 3 seconds
    set block {_block.loc} to {_block.block}
on block physics:
    cancel event
[doublepost=1491410807,1491410621][/doublepost]
Why are u setting local variables for that?
code_language.skript:
on build:
    cancel the event
    wait 3 seconds
    set block at event-location to event-block
becasue that don't woks :emoji_slight_smile: i dont know why but it don't work...
 
Status
Not open for further replies.