Help me please
Is the code supposed to do:
- 1. it defines the tools (or weapons) that are used by the attacker and the victim during combat
- 2. It then extracts the numeric values from the names of these tools.
- 3. If the attacker's tool is 4 or more units stronger than the victim's tool, the attack is canceled.
BUT! I can hit someone who has 1 lvl sword when I have 9 lvl sword, tools name format: Sword [9] and Sword [1]
```wb
on damage:
set {_attackerItem.%uuid of attacker%} to tool of attacker
set {_victimItem.%uuid of victim%} to tool of victim
set {_attackerNumber.%uuid of attacker%} to first element of split {_attackerItem.%uuid of attacker%}'s name at "[" parsed as integer
set {_victimNumber.%uuid of victim%} to first element of split {_victimItem.%uuid of victim%}'s name at "[" parsed as integer
if {_attackerNumber.%uuid of attacker%} - {_victimNumber.%uuid of victim%} >= 4:
cancel event
send "Your weapon is 4 or more units stronger than the beginner's, you can't hit it!" to attacker
```
Is the code supposed to do:
- 1. it defines the tools (or weapons) that are used by the attacker and the victim during combat
- 2. It then extracts the numeric values from the names of these tools.
- 3. If the attacker's tool is 4 or more units stronger than the victim's tool, the attack is canceled.
BUT! I can hit someone who has 1 lvl sword when I have 9 lvl sword, tools name format: Sword [9] and Sword [1]
```wb
on damage:
set {_attackerItem.%uuid of attacker%} to tool of attacker
set {_victimItem.%uuid of victim%} to tool of victim
set {_attackerNumber.%uuid of attacker%} to first element of split {_attackerItem.%uuid of attacker%}'s name at "[" parsed as integer
set {_victimNumber.%uuid of victim%} to first element of split {_victimItem.%uuid of victim%}'s name at "[" parsed as integer
if {_attackerNumber.%uuid of attacker%} - {_victimNumber.%uuid of victim%} >= 4:
cancel event
send "Your weapon is 4 or more units stronger than the beginner's, you can't hit it!" to attacker
```