#No work

1 messages · Page 1 of 1 (latest)

inland elk
#

Script for a piece of gold or sand to fall out when breaking sand with certain shovels with a 50% chance

on break of sand:
if player's tool is wooden shovel or stone shovel or iron shovel or gold shovel:
cancel event
set {_chance} to a random integer between 1 and 100
if {_chance} <= 50:
drop 1 gold nugget at location of block
else:
drop 1 sand at location of block
remove block

The error is that the sand is not removed from the place, here is the video:

#
#  Script for a piece of gold or sand to fall out when breaking sand with certain shovels with a 50% chance

on break of sand:
    if player's tool is wooden shovel or stone shovel or iron shovel or gold shovel:
        cancel event
        set {_chance} to a random integer between 1 and 100
        if {_chance} <= 50:
            drop 1 gold nugget at location of block
        else:
            drop 1 sand at location of block
        remove block
zenith crypt
#

try set event-block to air

inland elk
# zenith crypt try `set event-block to air`
on break of sand:
    if player's tool is wooden shovel or stone shovel or iron shovel or gold shovel:
        cancel event
        set {_chance} to a random integer between 1 and 100
        if {_chance} <= 50:
            drop 1 gold nugget at location of block
        else:
            drop 1 sand at location of block
        set event-block to air

Like this?

zenith crypt
#

Yeah

inland elk
#

I'll try, thanks

inland elk
visual cliff
#

then damage it

#

or update the durability

twilit steppe
#

why cancel the event? because cancelling the event will stop the block from breaking and prevents it from damaging the item

#

so just remove the cancel event and you wont need to make workarounds for damaging the item or setting the block to air

winter jungle
#

also, if you arent planning on adding more drops, just use chance of 50%:

#

line 2 can also be player's tool = any shovel

inland elk