Solved horse death

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

loadka95

Active Member
Feb 24, 2017
78
6
8
26
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_language.skript:
on vehicle exit:      
    set {mh.%player%} to false
    wait 3 tick
    loop all animals:
        if name of loop-value is "&c&l%player%'s horse":
            set the health of loop-value to 0

https://docs.skunity.com/syntax/effects/Kill
 
Last edited:
just add

clear drops

#edit

If errors come out. that you can't clear drops outside death events. well. then try this way:
code_language.skript:
on vehicle exit:     
    set {mh.%player%} to false
    wait 3 tick
    loop all animals:
        if name of loop-value is "&c&l%player%'s horse":
            set the health of loop-value to 0
            set {Horse::%loop-value%} to true

on death of horse:
    if {Horse::%victim%} is set:
        clear drops
 
Last edited:
  • Like
Reactions: loadka95
just add

clear drops

#edit

If errors come out. that you can't clear drops outside death events. well. then try this way:
code_language.skript:
on vehicle exit:    
    set {mh.%player%} to false
    wait 3 tick
    loop all animals:
        if name of loop-value is "&c&l%player%'s horse":
            set the health of loop-value to 0
            set {Horse::%loop-value%} to true

on death of horse:
    if {Horse::%victim%} is set:
        clear drops
It's worked, Thanks! :emoji_slight_smile:
 
Status
Not open for further replies.