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.

Solved Killing item drops.

Discussion in 'Skript' started by Aryaz25, May 20, 2018.

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

    Aryaz25 Member

    Joined:
    Apr 6, 2017
    Messages:
    23
    Likes Received:
    0
    I was trying to clear/kill an item drop after I pushed it in my "knife throwing" code.

    Code (Skript):
    1. set {_loc} to location of player's head
    2.                     drop 1 iron sword at {_loc}
    3.                     set {_item} to last dropped item
    4.                     push {_item} in direction of player at speed 0.5
    5.                     wait 2 ticks
    6.                     push {_item} upwards at speed 0.2
    7.                     push {_item} in direction of player at speed 0.5
    8.                     loop 12 times:
    9.                         loop all entities in radius 1 around {_item}:
    10.                             if loop-entity is set:
    11.                                 if loop-entity is alive:
    12.                                     if loop-entity isn't the player:
    13.                                         make player damage loop-entity by 1
    14.                                        
    15.                         wait 2 ticks
    16.                     clear {_item}
    17.                     send "item drop deleted!"
    In the last part, I was trying to kill/clear the {_item} entity, but it didnt :/ Can someone help?
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,499
    Likes Received:
    102
    Medals:
    Try
    Code (Skript):
    1. kill {_item}
    because clear will delete the variable
     
  3. Aryaz25

    Aryaz25 Member

    Joined:
    Apr 6, 2017
    Messages:
    23
    Likes Received:
    0
    Already did. In fact, I already did clear, delete, remove, kill, etc. I wouldn't post here before I tried everything I knew.
    --- Double Post Merged, May 20, 2018, Original Post Date: May 20, 2018 ---
    Just found a solution! My well-experienced friend just told me to use
    Code (Skript):
    1. Remove entity from {_item}
    to delete item drop entity! Ty for your help tho :emoji_slight_smile:
     
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...