i need help with "on 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 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!

ssongmu

Member
Oct 6, 2023
2
0
1
im using skript 2.7.1 /skbee-2.18 / skellett-2.0.9/ skquery-4.1.10 / skrayfall-1.9.28/ skript-gui-.3 / reflect / yaml/ utilities

Im keep getting error with this line
"if attacker's tool is bow: "
error message is "you can not use get bow expression in any event but 'on entity shoot: event!
can anyone help me with this?

Code:
on damage:
    set {_tool} to attacker's tool's type
    set {_tool} to "%{_tool}%"
    replace all {server.delete_item::*} and " " with "" in {_tool}
    if {_tool} is not "pickaxe":
        set {_lore::*} to uncolored lore of attacker's tool
        if attacker's tool is bow:
            if {_lore::3} is set:
                replace all "damage X " and " " with "" in {_lore::3}
                set {_lore::3} to {_lore::3} parsed as number
                set damage to damage * {_lore::3}
                remove {%victim%.defense} from damage
                send "&cdamage + %damage * 2%" to attacker
                if {_lore::4} is set:
                    replace all "ls X " and " " with "" in {_lore::4}
                    set {_lore::4} to {_lore::4} parsed as number
                    add damage * {_lore::4} to attacker's health
                    send "&dls + %damage * {_lore::4} * 2%" to attacker

            
        else if {_lore::3} is set:
            replace all "damage X " and " " with "" in {_lore::3}
            set {_lore::3} to {_lore::3} parsed as number
            set damage to damage * {_lore::3}
            remove {%victim%.defense} from damage
            send "&cdamage + %damage * 2%" to attacker
0.9.2