Solved Killing item drops.

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

Aryaz25

Member
Apr 6, 2017
23
0
1
31
I was trying to clear/kill an item drop after I pushed it in my "knife throwing" code.

code_language.skript:
set {_loc} to location of player's head
                    drop 1 iron sword at {_loc}
                    set {_item} to last dropped item
                    push {_item} in direction of player at speed 0.5
                    wait 2 ticks
                    push {_item} upwards at speed 0.2
                    push {_item} in direction of player at speed 0.5
                    loop 12 times:
                        loop all entities in radius 1 around {_item}:
                            if loop-entity is set:
                                if loop-entity is alive:
                                    if loop-entity isn't the player:
                                        make player damage loop-entity by 1
                                        
                        wait 2 ticks
                    clear {_item}
                    send "item drop deleted!"

In the last part, I was trying to kill/clear the {_item} entity, but it didnt :/ Can someone help?
 
Try
code_language.skript:
kill {_item}
because clear will delete the variable
 
Already did. In fact, I already did clear, delete, remove, kill, etc. I wouldn't post here before I tried everything I knew.
[doublepost=1526832358,1526832242][/doublepost]Just found a solution! My well-experienced friend just told me to use
code_language.skript:
Remove entity from {_item}
to delete item drop entity! Ty for your help tho :emoji_slight_smile:
 
Status
Not open for further replies.