My Skript has error and I'm new on Skript

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

RealStrike

Member
Feb 5, 2024
33
0
6
15
I want to make a skript for drill pickaxe like DonutSmp (while mining it with that certain Netherite pickaxe named drill pickaxe it will mine 3x3 blocks)
I created one but its not working
on break:
if tool is a netherite pickaxe:
if player has permission "drill.pickaxe":
set {_radius} to 1
set {_block} to event-block
loop {_x} from -{_radius} to {_radius}:
loop {_y} from -{_radius} to {_radius}:
loop {_z} from -{_radius} to {_radius}:
set {_target} to {_block} offset by {_x}, {_y}, {_z}
if {_target} is not {_block}:
if {_target} can be mined with a pickaxe and {_target} is obtainable in survival:
cancel event
drop {_target}
 
Last edited:
What's the error?
[12:16:55 INFO]: [Skript] Reloading drill.sk...
[12:16:55 INFO]: Line 5: (drill.sk)
[12:16:55 INFO]: There's no block in an on item break event
[12:16:55 INFO]: Line: set {_block} to event-block
[12:16:55 INFO]:
[12:16:55 INFO]: Line 6: (drill.sk)
[12:16:55 INFO]: Can't understand this loop: '{_x} from -{_radius} to {_radius}'
[12:16:55 INFO]: Line: loop {_x} from -{_radius} to {_radius}:
[12:16:55 INFO]:
[12:16:55 INFO]: [Skript] Encountered 2 errors while reloading drill.sk! (21ms)
Btw I Don't have any addons
 
This should work?
Code:
on break:
    player's tool is a netherite pickaxe
    player has permission "drill.pickaxe"
    add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
    set {_top} to block above event-block
    add block 1 right and block 1 left of {_top} to {_blocks::*}
    set {_bot} to block below event-block
    add block 1 left and block 1 right of {_bot} to {_blocks::*}
    {_blocks::*} is not bedrock or end portal frame
    set {-blocks::*} to air
    drop drops of {_blocks::*} at event-location
 
This should work?
Code:
on break:
    player's tool is a netherite pickaxe
    player has permission "drill.pickaxe"
    add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
    set {_top} to block above event-block
    add block 1 right and block 1 left of {_top} to {_blocks::*}
    set {_bot} to block below event-block
    add block 1 left and block 1 right of {_bot} to {_blocks::*}
    {_blocks::*} is not bedrock or end portal frame
    set {-blocks::*} to air
    drop drops of {_blocks::*} at event-location
Ya its kinda working the skript loaded without any errors but while i am breaking the blocks with the neth pick it drops the blocks 9,8,1,5 like this i think thats the blocks in the radius but the blocks actually not breaking. I totally appreciate your work but if you can figure out that also it would be great :emoji_grinning:
 
I don't understand this reply at all, what exactly is happening?
Also my code is wrong you have to set {_blocks::*} to air not {-blocks::*}
 
I don't understand this reply at all, what exactly is happening?
Also my code is wrong you have to set {_blocks::*} to air not {-blocks::*}
Oh while i was breaking blocks only one block breaked but dropped more than one block
 
on break:
player's tool is a netherite pickaxe
player has permission "drill.pickaxe"
add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
set {_top} to block above event-block
add block 1 right and block 1 left of {_top} to {_blocks::*}
set {_bot} to block below event-block
add block 1 left and block 1 right of {_bot} to {_blocks::*}
{_blocks::*} is not bedrock or end portal frame
set {_blocks::*} to air
drop drops of {_blocks::*} at event-location

This right, now it does nothing not even the blocks are dropping now
yeah just fix the code like i said
 
AppleScript:
on break:
    player's tool is a netherite pickaxe
    player has permission "drill.pickaxe"
    add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
    set {_top} to block above event-block
    add block 1 right and block 1 left of {_top} to {_blocks::*}
    set {_bot} to block below event-block
    add block 1 left and block 1 right of {_bot} to {_blocks::*}
    loop {_blocks::*}:
        loop-block is not bedrock or end portal frame
        drop drops of loop-block at event-location
        set loop-block to air
 
AppleScript:
on break:
    player's tool is a netherite pickaxe
    player has permission "drill.pickaxe"
    add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
    set {_top} to block above event-block
    add block 1 right and block 1 left of {_top} to {_blocks::*}
    set {_bot} to block below event-block
    add block 1 left and block 1 right of {_bot} to {_blocks::*}
    loop {_blocks::*}:
        loop-block is not bedrock or end portal frame
        drop drops of loop-block at event-location
        set loop-block to air
 

Attachments

  • IMG_20240419_110424.jpg
    IMG_20240419_110424.jpg
    90.4 KB · Views: 22
Sorry. Use loop-value
[13:31:25 INFO]: [Skript] Reloading drill.sk...
[13:31:25 INFO]: Line 12: (drill.sk)
[13:31:25 INFO]: loop-value can't be set to anything
[13:31:25 INFO]: Line: set loop-value to air
[13:31:25 INFO]:
[13:31:25 INFO]: [Skript] Encountered 1 error while reloading drill.sk! (93ms)
 
Try this
AppleScript:
on break:
    player's tool is a netherite pickaxe
    player has permission "drill.pickaxe"
    add block 1 left and block 1 right and block 1 above and block 1 below event-block to {_blocks::*}
    set {_top} to block above event-block
    add block 1 right and block 1 left of {_top} to {_blocks::*}
    set {_bot} to block below event-block
    add block 1 left and block 1 right of {_bot} to {_blocks::*}
    loop blocks at {_blocks::*}:
        loop-block is not bedrock or end portal frame
        drop drops of loop-block at event-location
        set loop-block to air