Help with killing a victim of damage

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

claytyne

Member
May 12, 2020
26
0
1
23
i want to make a code that instantly kills a ghast whenever it takes damage.

Code:
on damage:
    victim is ghast:
        world is "work":
            kill victim
            drop 5 golden nugget named "&6&l&oCoin" at location of victim
            play sound "entity.experience_orb.pickup" to attacker
            chance of 15%:
                give 1 diamond to attacker
                send "&b&lYou got a diamond!" to attacker

i also tried doing:

Code:
on damage of ghast:
    world is "world":
        chance of 15%:
            kill victim
            give 1 diamond to attacker
            send "&b&lYou got a diamond!" to attacker
            play sound "entity.experience_orb.pickup" to attacker
            stop
        else:
            drop 5 golden nugget named "&6&l&oCoin" at location of victim
            play sound "entity.experience_orb.pickup" to attacker
            kill victim
 
Last edited:
Code:
on damage of ghast:
    world is "world":
        wait 2 ticks
        chance of 15%:
            kill victim
            give 1 diamond to attacker
            send "&b&lYou got a diamond!" to attacker
            play sound "entity.experience_orb.pickup" to attacker
        drop 5 golden nugget named "&6&l&oCoin" at location of victim
        play sound "entity.experience_orb.pickup" to attacker
        kill victim
I fixed the drop of millions of nuggets but I couldn't fix the diamond dropping and nuggets at the same time
 
Status
Not open for further replies.