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 horse death

Discussion in 'Skript' started by loadka95, Jan 13, 2018.

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

    loadka95 Active Member

    Joined:
    Feb 24, 2017
    Messages:
    78
    Likes Received:
    6
    My problem is when I killed the horse It's drops leather and his saddle.
    But it's shouldn't happen when I set the health of the horse to 0.
    It's worked before, but now it's not working, still dropping the items.

    Code (Skript):
    1. on vehicle exit:      
    2.     set {mh.%player%} to false
    3.     wait 3 tick
    4.     loop all animals:
    5.         if name of loop-value is "&c&l%player%'s horse":
    6.             set the health of loop-value to 0
    https://docs.skunity.com/syntax/effects/Kill
     
    #1 loadka95, Jan 13, 2018
    Last edited: Jan 13, 2018
  2. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    just add

    clear drops

    #edit

    If errors come out. that you can't clear drops outside death events. well. then try this way:
    Code (Skript):
    1. on vehicle exit:    
    2.     set {mh.%player%} to false
    3.     wait 3 tick
    4.     loop all animals:
    5.         if name of loop-value is "&c&l%player%'s horse":
    6.             set the health of loop-value to 0
    7.             set {Horse::%loop-value%} to true
    8.  
    9. on death of horse:
    10.     if {Horse::%victim%} is set:
    11.         clear drops
     
    #2 ChisleLP, Jan 13, 2018
    Last edited: Jan 13, 2018
    loadka95 likes this.
  3. loadka95

    loadka95 Active Member

    Joined:
    Feb 24, 2017
    Messages:
    78
    Likes Received:
    6
    It's worked, Thanks! :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...