Remove cobweb 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.

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
22
How do I remove cobweb block?
I have tried delete entity, and this:
code_language.skript:
on rightclick with wood sword:
    name of player's tool is "&eWeb Slinger &7(Right Click)":
        set {_Waited} to difference between {Webslinger::%player%} and now
        if {_Waited} is less than 7.5 seconds:
            message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
            stop
        else:
            set {Webslinger::%player%} to now
            set {_loc} to location 4 meter above player's head
            push player upwards at speed 1
            wait 8 ticks
            play "SPIDER_IDLE" to player at volume 1
            spawn falling block of cobweb at {_loc}
            push last spawned entity in direction of player at speed 2
        
on block land:
    event-block is a cobweb:
        broadcast "TEST"
 
Nope:
code_language.skript:
on rightclick with wood sword:
    name of player's tool is "&eWeb Slinger &7(Right Click)":
        set {_Waited} to difference between {Webslinger::%player%} and now
        if {_Waited} is less than 7.5 seconds:
            message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
            stop
        else:
            set {Webslinger::%player%} to now
            set {_loc} to location 4 meter above player's head
            push player upwards at speed 1
            wait 8 ticks
            play "SPIDER_IDLE" to player at volume 1
            spawn falling block of cobweb at {_loc}
            push last spawned entity in direction of player at speed 2
        
on block land:
    last spawned entity is a cobweb:
        broadcast "TEST"
 
Nope, however, I noticed, if I dont add a delay to it removing the cobweb, it removes it in mid air. But if I add a delay, it doesnt remove the cobweb.
code_language.skript:
on rightclick with wood sword:
    name of player's tool is "&eWeb Slinger &7(Right Click)":
        set {_Waited} to difference between {Webslinger::%player%} and now
        if {_Waited} is less than 7.5 seconds:
            message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
            stop
        else:
            set {Webslinger::%player%} to now
            set {_loc} to location 4 meter above player's head
            push player upwards at speed 1
            wait 8 ticks
            play "SPIDER_IDLE" to player at volume 1
            spawn falling block of cobweb at {_loc}
            push last spawned entity in direction of player at speed 2
            wait 3 seconds
            delete last spawned entity
[doublepost=1502134404,1502134329][/doublepost]I wonder, if setting where the cobweb landed then deleting/setting that block to air would work?
 
I told you how to delete the falling block in your older thread. Use while loop, check for block under the block, then delete it if there is a solid block under the falling block.
 
Remember the item projectile you had trouble with? Same concept over here to remove the entity when it "lands" on a block.
1. Start the while loop after shooting the block. (with a tick wait)
2. Check for a block 0.3 meters below thrown block. If this condition is met, delete thrown block and end the while loop.

I copied this from your older thread, but modified it.
 
Oh, but how do I make the entity air, it doesnt pick it up...

Code:
code_language.skript:
on rightclick with wood sword:
    name of player's tool is "&eWeb Slinger &7(Right Click)":
        set {_Waited} to difference between {Webslinger::%player%} and now
        if {_Waited} is less than 7.5 seconds:
            message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
            stop
        else:
            set {Webslinger::%player%} to now
            set {_loc} to location 4 meter above player's head
            push player upwards at speed 1
            wait 8 ticks
            play "SPIDER_IDLE" to player at volume 1
            spawn falling block of cobweb at {_loc}
            push last spawned entity in direction of player at speed 2
            set {_LSE} to last spawned entity
            set {_t} to true
            while {_t} is true:
                if {_n} < 101:
                    if block 0.3 meters below falling block is not air:
                        set {_t} to false
                        set {_LSE} to air
                        
                    else:
                        add 1 to {n}
                        wait 1 tick
 
Status
Not open for further replies.