#setting blocks back

1 messages · Page 1 of 1 (latest)

odd ledge
#

i want to set blocks back to its original block

    if event-block is (cobblestone or stone):
        set {_blk} to event-block
        set event-block to air
        wait 5 seconds
        set event-block to {_blk}```

this is my code (there are way more types of blocks i want to check) and it does not work because for some reason {_blk} gets changed the moment after the wait.  so after waiting {_blk} gets set to air for some reason (before the wait {_blk} is still cobblestone/stone)
grizzled cairn
#

give me a second

odd ledge
#

ok

hexed kelp
#

You should save block type

#

Because the block gets updated

odd ledge
hexed kelp
#

set x to type of event block

#

Then it should be good

nimble cargo
#

as the server stops

#

it will stay air

#

forever

odd ledge
#

yes ik but idc

hexed kelp
#

Yep

odd ledge
hexed kelp
#

Wdym

odd ledge
#

like why does it change immediately after a wait i didnt set it to anything else

hexed kelp
#

?

grizzled cairn
#

i think its because if you debug %event-block% it contains a location and a location is not a block

odd ledge
#

i changed "type of" infront of event-block

#

and it works

hexed kelp
#

Oh

odd ledge
#

no

hexed kelp
#

Block gets updated

#

It pulls it from the block

odd ledge
#

when i broadcast it it says air

hexed kelp
#

Ye

odd ledge
#

when i broadcast the variable

hexed kelp
#

Because you set the block to air

grizzled cairn
#

remove this set event-block to air

odd ledge
#

when i broadcast variable before wait, it says stone/cobblestone the moment theres a "wait" it changes to air

hexed kelp
#

The var basically saves a location then checks the block at the location

odd ledge
#

i mean the variable {_blk}

#

not event-block

hexed kelp
#

So it gets updated

grizzled cairn
#

remove that

hexed kelp
#

When you change the block in the world

odd ledge
#

but i didnt even set the variable to anything else after that

grizzled cairn
#
    if event-block is cobblestone or stone:
        set {_blk} to type of event-block
        wait 5 seconds
        set event-block to {_blk}```
#

do this

odd ledge
#

ohh

#

yea i did

odd ledge
#

isnt that what u told me to do

hexed kelp
#

They just removed the part where you set it to air

odd ledge
#

oh

hexed kelp
#

Since its already air

#

You could set it to like bedrock or something if you want

odd ledge
#

no its not my actual code im not making a sky mining server or smth