Solved shoot break block

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

xbxy

Active Member
Jan 26, 2017
170
8
0
28
Code:
on rightclick with an sticks:
    make the player shoot a snowball at speed 2
On projectile hit:
    set {_t} to block at the location at event-location
    if {_block} is purpur_block:
        set {_block} to air
I try to make a snowball
Destroy the specified box with a snowball
But I found it hard to get the hit box
Seems to have a relationship with the launch radian
God can help you?

Code:
On projectile hit:
    create a fake explosion at event-location
    loop blocks in radius 2 around location at event-location:
        if loop-block is purpur_block:
            set loop-block to air
I also tried this method
But the effect is not ideal

Here's what I'm using
Server version is 1.11.2

[04:58:01 INFO]: [TuSKe] Disabling TuSKe v1.7
[04:58:01 INFO]: [SkQuery] Disabling SkQuery v3.5.1
[04:58:01 INFO]: [skRayFall] Disabling skRayFall v1.9.7
[04:58:01 INFO]: [skRayFall] Bacon has been eaten. Make some more soon!
[04:58:01 INFO]: [skDragon] Disabling skDragon v0.13.1
[04:58:01 INFO]: §3[§bskDragon§3] §aPlugin is now disabled. Most likely you shut down or reset your server
[04:58:01 INFO]: [Skellett] Disabling Skellett v1.7.7c
[04:58:01 INFO]: [SkStuff] Disabling SkStuff v1.6.4
[04:58:01 INFO]: [SkStuff] SkStuff 1.6.4 has been successfully disabled.
[04:58:01 INFO]: [Skript] Disabling Skript v2.2-dev23
 
So with an snowball this is a bit tricky i think, so a short code that didn't work perfect can look like this. This should work a bit better than yours but also not perfect :emoji_slight_smile:.

code_language.skript:
on rightclick with a stick:
    make the player shoot a snowball at speed 2
    stop
on projectile hit:
    if projectile is a snowball:
        wait 1 tick
        set {_location} to location of the projectile
        if block at {_location} isn't air:
            set block at {_location} to air
        clear {_location}
    stop

Note that I checked for a block that isn't air so you have to change it to your prefered block :emoji_wink:
 
So with an snowball this is a bit tricky i think, so a short code that didn't work perfect can look like this. This should work a bit better than yours but also not perfect :emoji_slight_smile:.

code_language.skript:
on rightclick with a stick:
    make the player shoot a snowball at speed 2
    stop
on projectile hit:
    if projectile is a snowball:
        wait 1 tick
        set {_location} to location of the projectile
        if block at {_location} isn't air:
            set block at {_location} to air
        clear {_location}
    stop

Note that I checked for a block that isn't air so you have to change it to your prefered block :emoji_wink:
I tested your work, thank you very much, he can get the box more accurately
Of course, he still has some flaws, but they are all insignificant

But with your work, I can make a snow digging game:emoji_smile:
 
I tested your work, thank you very much, he can get the box more accurately
Of course, he still has some flaws, but they are all insignificant

But with your work, I can make a snow digging game:emoji_smile:

Nice to hear :emoji_slight_smile:. I'm glad that I could help.
[doublepost=1485716413,1485603850][/doublepost]#Solved
 
Status
Not open for further replies.