#Sword where the sharpness increases per kill
1 messages · Page 1 of 1 (latest)
Hello!
For every player kill you can use this:
on death:
if victim is a player:
if attacker is a player:
set {_lvl} to level of sharpness of attacker's tool
set level of sharpness of attacker's tool to {_lvl}+1
message "&eYour weapon got sharpness upgraded to level %level of sharpness of attacker's tool%" to attacker
Hopefully this helps :)
alright thank you
No problem :D
how would i make it work for only one specific weapon
if attacker's item is stone sword named "name":
Add that in between if attacker is a player and set {_lvl} to level of sharpness of attacker's tool
Then change the type of item and name
alright thanks
Np, but if they aren't holding it you might need to loop their inventory, to check if they have it in there.
loop attacker's inventory:
if loop-value is stone sword named "name":```
This is only if you want any weapon in their inventory to increase the sharpness level of the specific item
If not just ignore lol
ok
on death:
if victim is a pig:
if attacker is a player:
if attacker's item is diamond sword:
set {_lvl} to level of sharpness of attacker's tool
set level of sharpness of attacker's tool to {_lvl}+1
message "&eYour weapon got sharpness upgraded to level %level of sharpness of attacker's tool%" to attacker
that wont work now did i do it wrong?
how much of a indent was it supposed to be?
Because there's a colon at the end, you will need to add 1 space to everything after it:
if victim is a player:
if attacker is a player:
if attacker's item is stone sword named "name":
set {_lvl} to level of sharpness of attacker's tool
set level of sharpness of attacker's tool to {_lvl}+1
message "&eYour weapon got sharpness upgraded to level %level of sharpness of attacker's tool%" to attacker```
okay