1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove cobweb block

Discussion in 'Skript' started by JustADev, Aug 7, 2017.

Thread Status:
Not open for further replies.
  1. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    How do I remove cobweb block?
    I have tried delete entity, and this:
    Code (Skript):
    1. on rightclick with wood sword:
    2.     name of player's tool is "&eWeb Slinger &7(Right Click)":
    3.         set {_Waited} to difference between {Webslinger::%player%} and now
    4.         if {_Waited} is less than 7.5 seconds:
    5.             message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
    6.             stop
    7.         else:
    8.             set {Webslinger::%player%} to now
    9.             set {_loc} to location 4 meter above player's head
    10.             push player upwards at speed 1
    11.             wait 8 ticks
    12.             play "SPIDER_IDLE" to player at volume 1
    13.             spawn falling block of cobweb at {_loc}
    14.             push last spawned entity in direction of player at speed 2
    15.        
    16. on block land:
    17.     event-block is a cobweb:
    18.         broadcast "TEST"
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    Try with last spawned entity
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    Nope:
    Code (Skript):
    1. on rightclick with wood sword:
    2.     name of player's tool is "&eWeb Slinger &7(Right Click)":
    3.         set {_Waited} to difference between {Webslinger::%player%} and now
    4.         if {_Waited} is less than 7.5 seconds:
    5.             message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
    6.             stop
    7.         else:
    8.             set {Webslinger::%player%} to now
    9.             set {_loc} to location 4 meter above player's head
    10.             push player upwards at speed 1
    11.             wait 8 ticks
    12.             play "SPIDER_IDLE" to player at volume 1
    13.             spawn falling block of cobweb at {_loc}
    14.             push last spawned entity in direction of player at speed 2
    15.        
    16. on block land:
    17.     last spawned entity is a cobweb:
    18.         broadcast "TEST"
    19.    
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    Not in the block land event..put it in the main code after a delay.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    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 (Skript):
    1. on rightclick with wood sword:
    2.     name of player's tool is "&eWeb Slinger &7(Right Click)":
    3.         set {_Waited} to difference between {Webslinger::%player%} and now
    4.         if {_Waited} is less than 7.5 seconds:
    5.             message "&8[&6Cooldown&8] &7You must wait &e%difference between {_Waited} and 7.5 seconds% &7to use your ability"
    6.             stop
    7.         else:
    8.             set {Webslinger::%player%} to now
    9.             set {_loc} to location 4 meter above player's head
    10.             push player upwards at speed 1
    11.             wait 8 ticks
    12.             play "SPIDER_IDLE" to player at volume 1
    13.             spawn falling block of cobweb at {_loc}
    14.             push last spawned entity in direction of player at speed 2
    15.             wait 3 seconds
    16.             delete last spawned entity
    17.        
    --- Double Post Merged, Aug 7, 2017, Original Post Date: Aug 7, 2017 ---
    I wonder, if setting where the cobweb landed then deleting/setting that block to air would work?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    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.
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    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.
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,177
    Likes Received:
    218
    Oh, but how do I make the entity air, it doesnt pick it up...

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

Share This Page

Loading...