#Why doesnt this work if my tool is damaged?
1 messages · Page 1 of 1 (latest)
It will also work if you just check the name and not the item itself
If you can assure this will be the only item with that name
But nbt better
Alr sure ill do this, ty
also every 10 ticks might lag your server
soo you want this to work if your tool is damaged?? you mean durbaily low?
Read the title
probally like this
loop all players:
if loop-player's held item is a netherite sword named "&6Life Sword":
if durability of loop-player's tool is not max durability of loop-player's tool:
apply strength 2 to loop-player for 0.5 seconds```
Just adjust the damage event instead of doing this loop shit
Nah imma close this i fixed it
So like x2 damage
On damage:
If players tool = x:
Make attacker damage victim by x hearts or damage em twice
My way is better but enjoy having a laggy ass server
@civic quail why u react skull emji
because he wanted to make the code work regardless of durability
ohh]
yeh
i did it tho
ill send the working code
loop all players:
set {_item} to loop-player's held item
if {_item} is set:
if name of {_item} is "&6Life Sword":
apply strength 2 to loop-player for 10 ticks```
Imagine having 5 people on a server like that and the tps being at like 10
fr
Ok, i appreciate what you had to say, and this is the code I now have.
if attacker is a player:
if attacker's tool is a netherite sword:
set {_name} to name of attacker's tool
if {_name} is "&6Life Sword":
set damage to damage * 1.2```
Thank you
tps isn't gonna drop from a 10 tick periodical
not unless you're doing some serious looping/calculations
still better to just use attributes/mess with on damage for that kind of thing, but they aren't the end of the world
in my experiance (I might have been doing something wrong) with wanting an expandable server you never really want to loop all players like that every 10 ticks
only time i ever do it is for an actionbar
action bar pmo
I dont loop every player for an action bar I more do while player is online for it but then its case by case i guess
Do you need that extra
if {_name} is "&6Life Sword":```
cause can't you just do if attack'ers too lis a netherite sword named this that
and then apply the damage
correct me if im wrong btw never played around with it
I do because I have to see if it is, and the other way won’t work if the item is damaged