On damage not working

  • 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 community!

    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!

xdle

Member
Oct 8, 2023
2
0
1
AppleScript:
on right click:
    if player's tool is black dye:
        if name of player's tool is "&5Candy &8Bat":
            if {cbcd.%player%} is not set:
                remove black dye named "&5Candy &8Bat" from player
                spawn a bat at player
                set {_bat} to last spawned bat
                broadcast "&6%player% has spawned a &5Candy &8Bat!"
                apply slowness 255 without particles to {_bat} for 999999 days
                set health of {_bat} to 200
                set name of {_bat} to "&5Candy &8Bat"
                set {cbcd.%player%} to 240
                loop 2400 times:
                    set {cbcd.%player%} to {cbcd.%player%}-0.1
                    wait 0.1 seconds
                delete {cbcd.%player%}
            else:
                send "&cOn cooldown for &e%{cbcd.%player%}%&c seconds!" to player

on damage:
    broadcast "&ctest"

on damage:
    broadcast "damage"
    set {_bat} to victim
    set {_rand} to a random number between 1 and 10
    set {_rand} to round({_rand})
    if {_rand} is 5:
        kill {_bat}
        broadcast "&6%player%'s bat has &cdied!"
    else:
        if attacker has a purple dye named "&5Candy talisman":
            set {_rand} to a random number from 10 to 20
            give attacker {_rand} amethyst shard named "&5Candy"
        else:
            set {_rand} to a random number from 2 to 10
            give attacker {_rand} amethyst shard named "&5Candy"
I have this skript and when i damage the bat it only sends &ctest, the on damage in my bat skript is not working. Is there any way to fix this?
 
AppleScript:
on right click:
    if player's tool is black dye:
        if name of player's tool is "&5Candy &8Bat":
            if {cbcd.%player%} is not set:
                remove black dye named "&5Candy &8Bat" from player
                spawn a bat at player
                set {_bat} to last spawned bat
                broadcast "&6%player% has spawned a &5Candy &8Bat!"
                apply slowness 255 without particles to {_bat} for 999999 days
                set health of {_bat} to 200
                set name of {_bat} to "&5Candy &8Bat"
                set {cbcd.%player%} to 240
                loop 2400 times:
                    set {cbcd.%player%} to {cbcd.%player%}-0.1
                    wait 0.1 seconds
                delete {cbcd.%player%}
            else:
                send "&cOn cooldown for &e%{cbcd.%player%}%&c seconds!" to player

on damage:
    broadcast "&ctest"

on damage:
    broadcast "damage"
    set {_bat} to victim
    set {_rand} to a random number between 1 and 10
    set {_rand} to round({_rand})
    if {_rand} is 5:
        kill {_bat}
        broadcast "&6%player%'s bat has &cdied!"
    else:
        if attacker has a purple dye named "&5Candy talisman":
            set {_rand} to a random number from 10 to 20
            give attacker {_rand} amethyst shard named "&5Candy"
        else:
            set {_rand} to a random number from 2 to 10
            give attacker {_rand} amethyst shard named "&5Candy"
I have this skript and when i damage the bat it only sends &ctest, the on damage in my bat skript is not working. Is there any way to fix this?
Your problem is that you have two on damage events. Use only one and combine them.
 
  • Like
Reactions: Luke_Sky_Walker